<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <!--<script type="text/javascript" src="com.iskitz.ajile.js"></script>-->
<script>
var $wnd = parent;
var $doc = $wnd.document;
var $moduleName = "TestApp";
var module_load_request = {};
var modules = {};
$doc.modules = modules;
var pyjs_options = new Object();
pyjs_options.set_all = function (v) {
    pyjs_options.arg_ignore = v;
    pyjs_options.arg_count = v;
    pyjs_options.arg_is_instance = v;
    pyjs_options.arg_instance_type = v;
    pyjs_options.arg_kwarg_dup = v;
    pyjs_options.arg_kwarg_unexpected_keyword = v;
    pyjs_options.arg_kwarg_multiple_values = v;
}
pyjs_options.set_all(true);
var trackstack = [];
var track = {module:'__main__', lineno: 1};
trackstack.push(track);
</script>

</head>
<body onload="if (parent && parent.__pygwt_webModeFrameOnLoad) parent.__pygwt_webModeFrameOnLoad(window, 'TestApp');">
<font face='arial' size='-1'>This script is part of module</font> <code>TestApp</code>



<script><!--

/* early app libs */


//
// BEGIN LIB sys
//

var sys = function (__mod_name__) {
	if(sys.__was_initialized__) return;
	sys.__was_initialized__ = true;
	if (__mod_name__ == null) __mod_name__ = 'sys';
	var __name__ = sys.__name__ = __mod_name__;
	sys.__track_lines__ = new Array();
	sys.__track_lines__[1] = "sys.py, line 1:\n    # the platform name (PyV8, smjs, Mozilla, IE6, Opera, Safari etc.)";
	sys.__track_lines__[2] = "sys.py, line 2:\n    platform = \'\' # to be updated by app, on compile";
	sys.__track_lines__[5] = "sys.py, line 5:\n    overrides = None # to be updated by app, on compile";
	sys.__track_lines__[8] = "sys.py, line 8:\n    loadpath = None";
	sys.__track_lines__[10] = "sys.py, line 10:\n    stacktrace = None";
	sys.__track_lines__[12] = "sys.py, line 12:\n    appname = None";
	sys.__track_lines__[14] = "sys.py, line 14:\n    def setloadpath(lp):";
	sys.__track_lines__[15] = "sys.py, line 15:\n    global loadpath";
	sys.__track_lines__[16] = "sys.py, line 16:\n    loadpath = lp";
	sys.__track_lines__[18] = "sys.py, line 18:\n    def setappname(an):";
	sys.__track_lines__[19] = "sys.py, line 19:\n    global appname";
	sys.__track_lines__[20] = "sys.py, line 20:\n    appname = an";
	sys.__track_lines__[22] = "sys.py, line 22:\n    def getloadpath():";
	sys.__track_lines__[23] = "sys.py, line 23:\n    global loadpath";
	sys.__track_lines__[24] = "sys.py, line 24:\n    return loadpath";
	sys.__track_lines__[26] = "sys.py, line 26:\n    def addoverride(module_name, path):";
	sys.__track_lines__[27] = "sys.py, line 27:\n    global overrides";
	sys.__track_lines__[28] = "sys.py, line 28:\n    overrides[module_name] = path";
	sys.__track_lines__[30] = "sys.py, line 30:\n    __last_exception__ = None";
	sys.__track_lines__[31] = "sys.py, line 31:\n    __last_exception_stack__ = None";
	sys.__track_lines__[32] = "sys.py, line 32:\n    def exc_info():";
	sys.__track_lines__[33] = "sys.py, line 33:\n    global __last_exception__";
	sys.__track_lines__[34] = "sys.py, line 34:\n    if not __last_exception__:";
	sys.__track_lines__[35] = "sys.py, line 35:\n    return (None, None, None)";
	sys.__track_lines__[36] = "sys.py, line 36:\n    return (__last_exception__.error.__class__, __last_exception__.error, None)";
	sys.__track_lines__[38] = "sys.py, line 38:\n    def exc_clear():";
	sys.__track_lines__[39] = "sys.py, line 39:\n    global __last_exception__";
	sys.__track_lines__[40] = "sys.py, line 40:\n    __last_exception__ = None";
	sys.__track_lines__[54] = "sys.py, line 43:\n    JS(\"\"\"sys.save_exception_stack = function () { ... }\"\"\")";
	sys.__track_lines__[56] = "sys.py, line 56:\n    def trackstackstr(stack=None):";
	sys.__track_lines__[57] = "sys.py, line 57:\n    global __last_exception_stack__";
	sys.__track_lines__[58] = "sys.py, line 58:\n    if stack is None:";
	sys.__track_lines__[59] = "sys.py, line 59:\n    stack = __last_exception_stack__";
	sys.__track_lines__[60] = "sys.py, line 60:\n    if not stack:";
	sys.__track_lines__[61] = "sys.py, line 61:\n    return \'\'";
	sys.__track_lines__[62] = "sys.py, line 62:\n    stackstrings = []";
	sys.__track_lines__[63] = "sys.py, line 63:\n    for s in list(stack):";
	sys.__track_lines__[64] = "sys.py, line 64:\n    JS(\"var msg = eval(s.module + \'.__track_lines__[\' + s.lineno + \']\');\")";
	sys.__track_lines__[65] = "sys.py, line 65:\n    if msg:";
	sys.__track_lines__[66] = "sys.py, line 66:\n    stackstrings.append(msg)";
	sys.__track_lines__[68] = "sys.py, line 68:\n    stackstrings.append(\'%s.py, line %d\' % (s.module, s.lineno))";
	sys.__track_lines__[69] = "sys.py, line 69:\n    return \'\\n\'.join(stackstrings)";
	track.module='sys';
	track.lineno=1;
	track.lineno=2;
	sys.platform = String('');
	track.lineno=5;
	sys.overrides = null;
	track.lineno=8;
	sys.loadpath = null;
	track.lineno=10;
	sys.stacktrace = null;
	track.lineno=12;
	sys.appname = null;
	track.lineno=14;
	sys.setloadpath = function(lp) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'sys',lineno:14};trackstack.push(track);
		track.module='sys';
		track.lineno=14;
		track.lineno=15;
		track.lineno=16;
		sys.loadpath = lp;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return null;
	};
	sys.setloadpath.__name__ = 'setloadpath';

	sys.setloadpath.parse_kwargs = function ( __kwargs, lp ) {
		if (typeof lp == 'undefined') {
			lp=__kwargs.lp;
			delete __kwargs.lp;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.lp != 'undefined') {
			pyjs__exception_func_multiple_values('sys.setloadpath', 'lp');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('sys.setloadpath', i);
			}
		}
		var __r = [lp];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=18;
	sys.setappname = function(an) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'sys',lineno:18};trackstack.push(track);
		track.module='sys';
		track.lineno=18;
		track.lineno=19;
		track.lineno=20;
		sys.appname = an;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return null;
	};
	sys.setappname.__name__ = 'setappname';

	sys.setappname.parse_kwargs = function ( __kwargs, an ) {
		if (typeof an == 'undefined') {
			an=__kwargs.an;
			delete __kwargs.an;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.an != 'undefined') {
			pyjs__exception_func_multiple_values('sys.setappname', 'an');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('sys.setappname', i);
			}
		}
		var __r = [an];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=22;
	sys.getloadpath = function() {
		if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 0, 0, arguments.length);
		track={module:'sys',lineno:22};trackstack.push(track);
		track.module='sys';
		track.lineno=22;
		track.lineno=23;
		track.lineno=24;
		track.lineno=24;
		var pyjs__ret = sys.loadpath;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	sys.getloadpath.__name__ = 'getloadpath';

	sys.getloadpath.parse_kwargs = function ( __kwargs ) {
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('sys.getloadpath', i);
			}
		}
		var __r = [];
		for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=26;
	sys.addoverride = function(module_name, path) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
		track={module:'sys',lineno:26};trackstack.push(track);
		track.module='sys';
		track.lineno=26;
		track.lineno=27;
		track.lineno=28;
		sys.overrides.__setitem__(module_name, path);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return null;
	};
	sys.addoverride.__name__ = 'addoverride';

	sys.addoverride.parse_kwargs = function ( __kwargs, module_name, path ) {
		if (typeof module_name == 'undefined') {
			module_name=__kwargs.module_name;
			delete __kwargs.module_name;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.module_name != 'undefined') {
			pyjs__exception_func_multiple_values('sys.addoverride', 'module_name');
		}
		if (typeof path == 'undefined') {
			path=__kwargs.path;
			delete __kwargs.path;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.path != 'undefined') {
			pyjs__exception_func_multiple_values('sys.addoverride', 'path');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('sys.addoverride', i);
			}
		}
		var __r = [module_name, path];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=30;
	sys.__last_exception__ = null;
	track.lineno=31;
	sys.__last_exception_stack__ = null;
	track.lineno=32;
	sys.exc_info = function() {
		if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 0, 0, arguments.length);
		track={module:'sys',lineno:32};trackstack.push(track);
		track.module='sys';
		track.lineno=32;
		track.lineno=33;
		track.lineno=34;
		if (pyjslib.bool(!(sys.__last_exception__))) {
			track.lineno=35;
			track.lineno=35;
			var pyjs__ret = new pyjslib.Tuple([null, null, null]);
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		track.lineno=36;
		track.lineno=36;
		var pyjs__ret = new pyjslib.Tuple([(sys.__last_exception__.error.__class__===undefined?(function(){throw new TypeError('sys.__last_exception__.error.__class__ is undefined')})():(typeof sys.__last_exception__.error.__class__ == 'function' && sys.__last_exception__.error.__is_instance__?pyjslib.getattr(sys.__last_exception__.error, '__class__'):sys.__last_exception__.error.__class__)), (sys.__last_exception__.error===undefined?(function(){throw new TypeError('sys.__last_exception__.error is undefined')})():(typeof sys.__last_exception__.error == 'function' && sys.__last_exception__.__is_instance__?pyjslib.getattr(sys.__last_exception__, 'error'):sys.__last_exception__.error)), null]);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	sys.exc_info.__name__ = 'exc_info';

	sys.exc_info.parse_kwargs = function ( __kwargs ) {
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('sys.exc_info', i);
			}
		}
		var __r = [];
		for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=38;
	sys.exc_clear = function() {
		if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 0, 0, arguments.length);
		track={module:'sys',lineno:38};trackstack.push(track);
		track.module='sys';
		track.lineno=38;
		track.lineno=39;
		track.lineno=40;
		sys.__last_exception__ = null;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return null;
	};
	sys.exc_clear.__name__ = 'exc_clear';

	sys.exc_clear.parse_kwargs = function ( __kwargs ) {
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('sys.exc_clear', i);
			}
		}
		var __r = [];
		for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=54;
sys.save_exception_stack = function () {
    var save_stack = [];
    for (var needle in trackstack) {
        var t = new Object();
        for (var p in trackstack[needle]) {
            t[p] = trackstack[needle][p];
        }
        save_stack.push(t);
        sys.__last_exception_stack__ = save_stack;
    }
return null;
}
	track.lineno=56;
	sys.trackstackstr = function(stack) {
		if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 1)) pyjs__exception_func_param(arguments.callee.__name__, 0, 1, arguments.length);
		if (typeof stack == 'undefined') stack=null;
		track={module:'sys',lineno:56};trackstack.push(track);
		track.module='sys';
		track.lineno=56;
		track.lineno=57;
		track.lineno=58;
		if (pyjslib.bool((stack === null))) {
			track.lineno=59;
			stack = sys.__last_exception_stack__;
		}
		track.lineno=60;
		if (pyjslib.bool(!(stack))) {
			track.lineno=61;
			track.lineno=61;
			var pyjs__ret = String('');
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		track.lineno=62;
		var stackstrings = new pyjslib.List([]);
		track.lineno=63;
		var pyjs__trackstack_size_1=trackstack.length;
		var __s = pyjslib.list(stack).__iter__();
		try {
			while (true) {
				var s = __s.next();
				
				track.lineno=64;
var msg = eval(s.module + '.__track_lines__[' + s.lineno + ']');
				track.lineno=65;
				if (pyjslib.bool(msg)) {
					track.lineno=66;
					stackstrings.append(msg);
				}
				else {
					track.lineno=68;
					stackstrings.append(pyjslib.sprintf(String('%s.py, line %d'), new pyjslib.Tuple([(s.module===undefined?(function(){throw new TypeError('s.module is undefined')})():(typeof s.module == 'function' && s.__is_instance__?pyjslib.getattr(s, 'module'):s.module)), (s.lineno===undefined?(function(){throw new TypeError('s.lineno is undefined')})():(typeof s.lineno == 'function' && s.__is_instance__?pyjslib.getattr(s, 'lineno'):s.lineno))])));
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (trackstack.length > pyjs__trackstack_size_1) {
			trackstack = trackstack.slice(0,pyjs__trackstack_size_1);
			track = trackstack.slice(-1)[0];
		}
		track.module='sys';
		track.lineno=69;
		track.lineno=69;
		var pyjs__ret = String('\x0A').join(stackstrings);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	sys.trackstackstr.__name__ = 'trackstackstr';

	sys.trackstackstr.parse_kwargs = function ( __kwargs, stack ) {
		if (typeof stack == 'undefined') {
			stack=__kwargs.stack;
			delete __kwargs.stack;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.stack != 'undefined') {
			pyjs__exception_func_multiple_values('sys.trackstackstr', 'stack');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('sys.trackstackstr', i);
			}
		}
		var __r = [stack];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};

return this;
}; /* end sys */ 


/* initialize static library */
sys();


//
// END LIB sys
//


//
// BEGIN LIB pyjslib
//

var pyjslib = function (__mod_name__) {
	if(pyjslib.__was_initialized__) return;
	pyjslib.__was_initialized__ = true;
	if (__mod_name__ == null) __mod_name__ = 'pyjslib';
	var __name__ = pyjslib.__name__ = __mod_name__;
	pyjslib.__track_lines__ = new Array();
	pyjslib.__track_lines__[512] = "pyjslib.py, line 512:\n    return self.name";
	pyjslib.__track_lines__[1] = "pyjslib.py, line 1:\n    # Copyright 2006 James Tauber and contributors";
	pyjslib.__track_lines__[1538] = "pyjslib.py, line 1538:\n    maxValue = item";
	pyjslib.__track_lines__[515] = "pyjslib.py, line 514:\n    @noSourceTracking ... def eq(a,b):";
	pyjslib.__track_lines__[1540] = "pyjslib.py, line 1540:\n    maxValue = item";
	pyjslib.__track_lines__[1541] = "pyjslib.py, line 1541:\n    return maxValue";
	pyjslib.__track_lines__[1537] = "pyjslib.py, line 1537:\n    if maxValue is None:";
	pyjslib.__track_lines__[1544] = "pyjslib.py, line 1544:\n    next_hash_id = 0";
	pyjslib.__track_lines__[1547] = "pyjslib.py, line 1546:\n    @noSourceTracking ... def hash(obj):";
	pyjslib.__track_lines__[18] = "pyjslib.py, line 18:\n    from __pyjamas__ import JS";
	pyjslib.__track_lines__[23] = "pyjslib.py, line 22:\n    @noSourceTracking ... def import_module(path, parent_module, module_name, dynamic=1, async=False):";
	pyjslib.__track_lines__[536] = "pyjslib.py, line 535:\n    @noSourceTracking ... def cmp(a,b):";
	pyjslib.__track_lines__[1562] = "pyjslib.py, line 1562:\n    def hash(obj):";
	pyjslib.__track_lines__[1572] = "pyjslib.py, line 1563:\n    JS(\"\"\" ... \"\"\")";
	pyjslib.__track_lines__[1576] = "pyjslib.py, line 1575:\n    @noSourceTracking ... def isObject(a):";
	pyjslib.__track_lines__[556] = "pyjslib.py, line 555:\n    @noSourceTracking ... def bool(v):";
	pyjslib.__track_lines__[1582] = "pyjslib.py, line 1581:\n    @noSourceTracking ... def isFunction(a):";
	pyjslib.__track_lines__[1586] = "pyjslib.py, line 1586:\n    callable = isFunction";
	pyjslib.__track_lines__[1589] = "pyjslib.py, line 1588:\n    @noSourceTracking ... def isString(a):";
	pyjslib.__track_lines__[1536] = "pyjslib.py, line 1536:\n    for item in sequence:";
	pyjslib.__track_lines__[1595] = "pyjslib.py, line 1594:\n    @noSourceTracking ... def isNull(a):";
	pyjslib.__track_lines__[576] = "pyjslib.py, line 576:\n    class List:";
	pyjslib.__track_lines__[1601] = "pyjslib.py, line 1600:\n    @noSourceTracking ... def isArray(a):";
	pyjslib.__track_lines__[1607] = "pyjslib.py, line 1606:\n    @noSourceTracking ... def isUndefined(a):";
	pyjslib.__track_lines__[1613] = "pyjslib.py, line 1612:\n    @noSourceTracking ... def isIteratable(a):";
	pyjslib.__track_lines__[1619] = "pyjslib.py, line 1618:\n    @noSourceTracking ... def isNumber(a):";
	pyjslib.__track_lines__[1625] = "pyjslib.py, line 1624:\n    @noSourceTracking ... def toJSObjects(x):";
	pyjslib.__track_lines__[1295] = "pyjslib.py, line 1294:\n    @noSourceTracking ... def repr(x):";
	pyjslib.__track_lines__[1133] = "pyjslib.py, line 1133:\n    def __repr__(self):";
	pyjslib.__track_lines__[110] = "pyjslib.py, line 109:\n    @noSourceTracking ... def import_wait(proceed_fn, parent_mod, dynamic):";
	pyjslib.__track_lines__[1535] = "pyjslib.py, line 1535:\n    maxValue = None";
	pyjslib.__track_lines__[1152] = "pyjslib.py, line 1138:\n    JS(\"\"\" ... \"\"\")";
	pyjslib.__track_lines__[1154] = "pyjslib.py, line 1154:\n    dict = Dict";
	pyjslib.__track_lines__[1899] = "pyjslib.py, line 1899:\n    return float(p)";
	pyjslib.__track_lines__[1669] = "pyjslib.py, line 1668:\n    @noSourceTracking ... def sprintf(strng, args):";
	pyjslib.__track_lines__[1158] = "pyjslib.py, line 1157:\n    @noSourceTracking ... def _super(type_, object_or_type = None):";
	pyjslib.__track_lines__[1192] = "pyjslib.py, line 1191:\n    @noSourceTracking ... def range(start, stop = None, step = 1):";
	pyjslib.__track_lines__[188] = "pyjslib.py, line 188:\n    class object:";
	pyjslib.__track_lines__[191] = "pyjslib.py, line 191:\n    Object = object";
	pyjslib.__track_lines__[193] = "pyjslib.py, line 193:\n    class Modload:";
	pyjslib.__track_lines__[1227] = "pyjslib.py, line 1226:\n    @noSourceTracking ... def slice(object, lower, upper):";
	pyjslib.__track_lines__[711] = "pyjslib.py, line 711:\n    def sort(self, compareFunc=None, keyFunc=None, reverse=False):";
	pyjslib.__track_lines__[712] = "pyjslib.py, line 712:\n    if not compareFunc:";
	pyjslib.__track_lines__[713] = "pyjslib.py, line 713:\n    global cmp";
	pyjslib.__track_lines__[714] = "pyjslib.py, line 714:\n    compareFunc = cmp";
	pyjslib.__track_lines__[715] = "pyjslib.py, line 715:\n    if keyFunc and reverse:";
	pyjslib.__track_lines__[716] = "pyjslib.py, line 716:\n    def thisSort1(a,b):";
	pyjslib.__track_lines__[717] = "pyjslib.py, line 717:\n    return -compareFunc(keyFunc(a), keyFunc(b))";
	pyjslib.__track_lines__[718] = "pyjslib.py, line 718:\n    self.l.sort(thisSort1)";
	pyjslib.__track_lines__[720] = "pyjslib.py, line 720:\n    def thisSort2(a,b):";
	pyjslib.__track_lines__[721] = "pyjslib.py, line 721:\n    return compareFunc(keyFunc(a), keyFunc(b))";
	pyjslib.__track_lines__[722] = "pyjslib.py, line 722:\n    self.l.sort(thisSort2)";
	pyjslib.__track_lines__[724] = "pyjslib.py, line 724:\n    def thisSort3(a,b):";
	pyjslib.__track_lines__[725] = "pyjslib.py, line 725:\n    return -compareFunc(a, b)";
	pyjslib.__track_lines__[726] = "pyjslib.py, line 726:\n    self.l.sort(thisSort3)";
	pyjslib.__track_lines__[728] = "pyjslib.py, line 728:\n    self.l.sort(compareFunc)";
	pyjslib.__track_lines__[218] = "pyjslib.py, line 218:\n    def get_module(module_name):";
	pyjslib.__track_lines__[219] = "pyjslib.py, line 219:\n    ev = \"__mod = %s;\" % module_name";
	pyjslib.__track_lines__[220] = "pyjslib.py, line 220:\n    JS(\"pyjs_eval(ev);\")";
	pyjslib.__track_lines__[221] = "pyjslib.py, line 221:\n    return __mod";
	pyjslib.__track_lines__[1246] = "pyjslib.py, line 1245:\n    @noSourceTracking ... def str(text):";
	pyjslib.__track_lines__[223] = "pyjslib.py, line 223:\n    def preload_app_modules(path, app_modnames, app_imported_fn, dynamic,";
	pyjslib.__track_lines__[226] = "pyjslib.py, line 226:\n    loader = Modload(path, app_modnames, app_imported_fn, dynamic, parent_mod)";
	pyjslib.__track_lines__[227] = "pyjslib.py, line 227:\n    loader.next()";
	pyjslib.__track_lines__[229] = "pyjslib.py, line 229:\n    import sys";
	pyjslib.__track_lines__[231] = "pyjslib.py, line 231:\n    class BaseException:";
	pyjslib.__track_lines__[745] = "pyjslib.py, line 745:\n    def __repr__(self):";
	pyjslib.__track_lines__[235] = "pyjslib.py, line 235:\n    def __init__(self, *args):";
	pyjslib.__track_lines__[236] = "pyjslib.py, line 236:\n    self.args = args";
	pyjslib.__track_lines__[237] = "pyjslib.py, line 237:\n    if len(args) == 1:";
	pyjslib.__track_lines__[238] = "pyjslib.py, line 238:\n    self.message = args[0]";
	pyjslib.__track_lines__[240] = "pyjslib.py, line 240:\n    def __str__(self):";
	pyjslib.__track_lines__[241] = "pyjslib.py, line 241:\n    if len(self.args) is 0:";
	pyjslib.__track_lines__[242] = "pyjslib.py, line 242:\n    return \'\'";
	pyjslib.__track_lines__[1267] = "pyjslib.py, line 1266:\n    @noSourceTracking ... def chr(x):";
	pyjslib.__track_lines__[244] = "pyjslib.py, line 244:\n    return str(self.message)";
	pyjslib.__track_lines__[245] = "pyjslib.py, line 245:\n    return repr(self.args)";
	pyjslib.__track_lines__[759] = "pyjslib.py, line 750:\n    JS(\"\"\" ... \"\"\")";
	pyjslib.__track_lines__[248] = "pyjslib.py, line 248:\n    return self.__name__ + repr(self.args)";
	pyjslib.__track_lines__[761] = "pyjslib.py, line 761:\n    list = List";
	pyjslib.__track_lines__[250] = "pyjslib.py, line 250:\n    def toString(self):";
	pyjslib.__track_lines__[763] = "pyjslib.py, line 763:\n    class Tuple:";
	pyjslib.__track_lines__[253] = "pyjslib.py, line 253:\n    class Exception(BaseException):";
	pyjslib.__track_lines__[256] = "pyjslib.py, line 256:\n    class StandardError(Exception):";
	pyjslib.__track_lines__[259] = "pyjslib.py, line 259:\n    class TypeError(StandardError):";
	pyjslib.__track_lines__[1285] = "pyjslib.py, line 1284:\n    @noSourceTracking ... def get_pyjs_classtype(x):";
	pyjslib.__track_lines__[262] = "pyjslib.py, line 262:\n    class LookupError(StandardError):";
	pyjslib.__track_lines__[264] = "pyjslib.py, line 264:\n    def toString(self):";
	pyjslib.__track_lines__[265] = "pyjslib.py, line 265:\n    return self.__name__ + \": \" + self.args[0]";
	pyjslib.__track_lines__[267] = "pyjslib.py, line 267:\n    class KeyError(LookupError):";
	pyjslib.__track_lines__[269] = "pyjslib.py, line 269:\n    def __str__(self):";
	pyjslib.__track_lines__[270] = "pyjslib.py, line 270:\n    if len(self.args) is 0:";
	pyjslib.__track_lines__[271] = "pyjslib.py, line 271:\n    return \'\'";
	pyjslib.__track_lines__[273] = "pyjslib.py, line 273:\n    return repr(self.message)";
	pyjslib.__track_lines__[274] = "pyjslib.py, line 274:\n    return repr(self.args)";
	pyjslib.__track_lines__[276] = "pyjslib.py, line 276:\n    class AttributeError(StandardError):";
	pyjslib.__track_lines__[278] = "pyjslib.py, line 278:\n    def toString(self):";
	pyjslib.__track_lines__[279] = "pyjslib.py, line 279:\n    return \"AttributeError: %s of %s\" % (self.args[1], self.args[0])";
	pyjslib.__track_lines__[281] = "pyjslib.py, line 281:\n    class NameError(StandardError):";
	pyjslib.__track_lines__[284] = "pyjslib.py, line 284:\n    class ValueError(StandardError):";
	pyjslib.__track_lines__[287] = "pyjslib.py, line 287:\n    class IndexError(LookupError):";
	pyjslib.__track_lines__[1932] = "pyjslib.py, line 1932:\n    def any(iterable):";
	pyjslib.__track_lines__[1354] = "pyjslib.py, line 1353:\n    @noSourceTracking ... def float(text):";
	pyjslib.__track_lines__[1869] = "pyjslib.py, line 1868:\n    @noSourceTracking ... def printFunc(objs, newline):";
	pyjslib.__track_lines__[1933] = "pyjslib.py, line 1933:\n    for element in iterable:";
	pyjslib.__track_lines__[1360] = "pyjslib.py, line 1359:\n    @noSourceTracking ... def int(text, radix=0):";
	pyjslib.__track_lines__[1934] = "pyjslib.py, line 1934:\n    if element:";
	pyjslib.__track_lines__[1366] = "pyjslib.py, line 1365:\n    @noSourceTracking ... def len(object):";
	pyjslib.__track_lines__[1881] = "pyjslib.py, line 1880:\n    @noSourceTracking ... def type(clsname, bases=None, methods=None):";
	pyjslib.__track_lines__[1935] = "pyjslib.py, line 1935:\n    return True";
	pyjslib.__track_lines__[1374] = "pyjslib.py, line 1373:\n    @noSourceTracking ... def isinstance(object_, classinfo):";
	pyjslib.__track_lines__[1936] = "pyjslib.py, line 1936:\n    return False";
	pyjslib.__track_lines__[1529] = "pyjslib.py, line 1529:\n    return minValue";
	pyjslib.__track_lines__[1495] = "pyjslib.py, line 1494:\n    @noSourceTracking ... def map(obj, method, sequence=None):";
	pyjslib.__track_lines__[1896] = "pyjslib.py, line 1896:\n    def pow(x, y, z = None):";
	pyjslib.__track_lines__[1897] = "pyjslib.py, line 1897:\n    JS(\"p = Math.pow(x, y);\")";
	pyjslib.__track_lines__[1898] = "pyjslib.py, line 1898:\n    if z is None:";
	pyjslib.__track_lines__[1255] = "pyjslib.py, line 1254:\n    @noSourceTracking ... def ord(x):";
	pyjslib.__track_lines__[1900] = "pyjslib.py, line 1900:\n    return float(p % z)";
	pyjslib.__track_lines__[1389] = "pyjslib.py, line 1388:\n    @noSourceTracking ... def _isinstance(object_, classinfo):";
	pyjslib.__track_lines__[1902] = "pyjslib.py, line 1902:\n    def hex(x):";
	pyjslib.__track_lines__[1903] = "pyjslib.py, line 1903:\n    if int(x) != x:";
	pyjslib.__track_lines__[1904] = "pyjslib.py, line 1904:\n    raise TypeError(\"hex() argument can\'t be converted to hex\")";
	pyjslib.__track_lines__[1905] = "pyjslib.py, line 1905:\n    JS(\"r = \'0x\'+x.toString(16);\")";
	pyjslib.__track_lines__[1906] = "pyjslib.py, line 1906:\n    return str(r)";
	pyjslib.__track_lines__[1908] = "pyjslib.py, line 1908:\n    def oct(x):";
	pyjslib.__track_lines__[1909] = "pyjslib.py, line 1909:\n    if int(x) != x:";
	pyjslib.__track_lines__[1910] = "pyjslib.py, line 1910:\n    raise TypeError(\"oct() argument can\'t be converted to oct\")";
	pyjslib.__track_lines__[1911] = "pyjslib.py, line 1911:\n    JS(\"r = \'0\'+x.toString(8);\")";
	pyjslib.__track_lines__[1912] = "pyjslib.py, line 1912:\n    return str(r)";
	pyjslib.__track_lines__[1401] = "pyjslib.py, line 1400:\n    @noSourceTracking ... def _issubtype(object_, classinfo):";
	pyjslib.__track_lines__[1914] = "pyjslib.py, line 1914:\n    def round(x, n = 0):";
	pyjslib.__track_lines__[1915] = "pyjslib.py, line 1915:\n    n = pow(10, n)";
	pyjslib.__track_lines__[1916] = "pyjslib.py, line 1916:\n    JS(\"r = Math.round(n*x)/n;\")";
	pyjslib.__track_lines__[1917] = "pyjslib.py, line 1917:\n    return float(r)";
	pyjslib.__track_lines__[1919] = "pyjslib.py, line 1919:\n    def divmod(x, y):";
	pyjslib.__track_lines__[1920] = "pyjslib.py, line 1920:\n    if int(x) == x and int(y) == y:";
	pyjslib.__track_lines__[1921] = "pyjslib.py, line 1921:\n    return (int(x / y), int(x % y))";
	pyjslib.__track_lines__[1922] = "pyjslib.py, line 1922:\n    JS(\"f = Math.floor(x / y);\")";
	pyjslib.__track_lines__[1923] = "pyjslib.py, line 1923:\n    f = float(f)";
	pyjslib.__track_lines__[1924] = "pyjslib.py, line 1924:\n    return (f, x - f * y)";
	pyjslib.__track_lines__[1413] = "pyjslib.py, line 1412:\n    @noSourceTracking ... def getattr(obj, name, default=None):";
	pyjslib.__track_lines__[1926] = "pyjslib.py, line 1926:\n    def all(iterable):";
	pyjslib.__track_lines__[1927] = "pyjslib.py, line 1927:\n    for element in iterable:";
	pyjslib.__track_lines__[1928] = "pyjslib.py, line 1928:\n    if not element:";
	pyjslib.__track_lines__[1929] = "pyjslib.py, line 1929:\n    return False";
	pyjslib.__track_lines__[1930] = "pyjslib.py, line 1930:\n    return True";
	pyjslib.__track_lines__[908] = "pyjslib.py, line 908:\n    def sort(self, compareFunc=None, keyFunc=None, reverse=False):";
	pyjslib.__track_lines__[909] = "pyjslib.py, line 909:\n    if not compareFunc:";
	pyjslib.__track_lines__[910] = "pyjslib.py, line 910:\n    global cmp";
	pyjslib.__track_lines__[911] = "pyjslib.py, line 911:\n    compareFunc = cmp";
	pyjslib.__track_lines__[912] = "pyjslib.py, line 912:\n    if keyFunc and reverse:";
	pyjslib.__track_lines__[913] = "pyjslib.py, line 913:\n    def thisSort1(a,b):";
	pyjslib.__track_lines__[914] = "pyjslib.py, line 914:\n    return -compareFunc(keyFunc(a), keyFunc(b))";
	pyjslib.__track_lines__[915] = "pyjslib.py, line 915:\n    self.l.sort(thisSort1)";
	pyjslib.__track_lines__[917] = "pyjslib.py, line 917:\n    def thisSort2(a,b):";
	pyjslib.__track_lines__[918] = "pyjslib.py, line 918:\n    return compareFunc(keyFunc(a), keyFunc(b))";
	pyjslib.__track_lines__[919] = "pyjslib.py, line 919:\n    self.l.sort(thisSort2)";
	pyjslib.__track_lines__[921] = "pyjslib.py, line 921:\n    def thisSort3(a,b):";
	pyjslib.__track_lines__[922] = "pyjslib.py, line 922:\n    return -compareFunc(a, b)";
	pyjslib.__track_lines__[923] = "pyjslib.py, line 923:\n    self.l.sort(thisSort3)";
	pyjslib.__track_lines__[925] = "pyjslib.py, line 925:\n    self.l.sort(compareFunc)";
	pyjslib.__track_lines__[1449] = "pyjslib.py, line 1448:\n    @noSourceTracking ... def setattr(obj, name, value):";
	pyjslib.__track_lines__[942] = "pyjslib.py, line 942:\n    def __repr__(self):";
	pyjslib.__track_lines__[1437] = "pyjslib.py, line 1436:\n    @noSourceTracking ... def delattr(obj, name):";
	pyjslib.__track_lines__[1458] = "pyjslib.py, line 1457:\n    @noSourceTracking ... def hasattr(obj, name):";
	pyjslib.__track_lines__[1467] = "pyjslib.py, line 1466:\n    @noSourceTracking ... def dir(obj):";
	pyjslib.__track_lines__[1532] = "pyjslib.py, line 1532:\n    def max(*sequence):";
	pyjslib.__track_lines__[960] = "pyjslib.py, line 949:\n    JS(\"\"\" ... \"\"\")";
	pyjslib.__track_lines__[962] = "pyjslib.py, line 962:\n    tuple = Tuple";
	pyjslib.__track_lines__[1475] = "pyjslib.py, line 1474:\n    @noSourceTracking ... def filter(obj, method, sequence=None):";
	pyjslib.__track_lines__[965] = "pyjslib.py, line 965:\n    class Dict:";
	pyjslib.__track_lines__[247] = "pyjslib.py, line 247:\n    def __repr__(self):";
	pyjslib.__track_lines__[1273] = "pyjslib.py, line 1272:\n    @noSourceTracking ... def is_basetype(x):";
	pyjslib.__track_lines__[251] = "pyjslib.py, line 251:\n    return str(self)";
	pyjslib.__track_lines__[1511] = "pyjslib.py, line 1511:\n    def enumerate(sequence):";
	pyjslib.__track_lines__[1512] = "pyjslib.py, line 1512:\n    enumeration = []";
	pyjslib.__track_lines__[1513] = "pyjslib.py, line 1513:\n    nextIndex = 0";
	pyjslib.__track_lines__[1514] = "pyjslib.py, line 1514:\n    for item in sequence:";
	pyjslib.__track_lines__[1515] = "pyjslib.py, line 1515:\n    enumeration.append([nextIndex, item])";
	pyjslib.__track_lines__[1516] = "pyjslib.py, line 1516:\n    nextIndex = nextIndex + 1";
	pyjslib.__track_lines__[1517] = "pyjslib.py, line 1517:\n    return enumeration";
	pyjslib.__track_lines__[1533] = "pyjslib.py, line 1533:\n    if len(sequence) == 1:";
	pyjslib.__track_lines__[1520] = "pyjslib.py, line 1520:\n    def min(*sequence):";
	pyjslib.__track_lines__[1521] = "pyjslib.py, line 1521:\n    if len(sequence) == 1:";
	pyjslib.__track_lines__[1522] = "pyjslib.py, line 1522:\n    sequence = sequence[0]";
	pyjslib.__track_lines__[1523] = "pyjslib.py, line 1523:\n    minValue = None";
	pyjslib.__track_lines__[1524] = "pyjslib.py, line 1524:\n    for item in sequence:";
	pyjslib.__track_lines__[1525] = "pyjslib.py, line 1525:\n    if minValue is None:";
	pyjslib.__track_lines__[1526] = "pyjslib.py, line 1526:\n    minValue = item";
	pyjslib.__track_lines__[1528] = "pyjslib.py, line 1528:\n    minValue = item";
	pyjslib.__track_lines__[505] = "pyjslib.py, line 293:\n    JS(\"\"\" ... \"\"\")";
	pyjslib.__track_lines__[507] = "pyjslib.py, line 507:\n    class Class:";
	pyjslib.__track_lines__[508] = "pyjslib.py, line 508:\n    def __init__(self, name):";
	pyjslib.__track_lines__[509] = "pyjslib.py, line 509:\n    self.name = name";
	pyjslib.__track_lines__[1534] = "pyjslib.py, line 1534:\n    sequence = sequence[0]";
	pyjslib.__track_lines__[511] = "pyjslib.py, line 511:\n    def __str___(self):";
	track.module='pyjslib';
	track.lineno=1;
	track.lineno=18;
	track.lineno=23;
	pyjslib.import_module = function(path, parent_module, module_name, dynamic, async) {
		if (pyjs_options.arg_count && (arguments.length < 3 || arguments.length > 5)) pyjs__exception_func_param(arguments.callee.__name__, 3, 5, arguments.length);
		if (typeof dynamic == 'undefined') dynamic=1;
		if (typeof async == 'undefined') async=false;

        var cache_file;

        if (module_name == "sys" || module_name == 'pyjslib')
        {
            /*module_load_request[module_name] = 1;*/
            return;
        }

        if (path == null)
        {
            path = './';
        }

        var override_name = sys.platform + "." + module_name;
        if (((sys.overrides != null) && 
             (sys.overrides.has_key(override_name))))
        {
            cache_file =  sys.overrides.__getitem__(override_name) ;
        }
        else
        {
            cache_file =  module_name ;
        }

        cache_file = (path + cache_file + '.cache.js' ) ;

        //alert("cache " + cache_file + " " + module_name + " " + parent_module);

        /* already loaded? */
        if (module_load_request[module_name])
        {
            if (module_load_request[module_name] >= 3 && parent_module != null)
            {
                //onload_fn = parent_module + '.' + module_name + ' = ' + module_name + ';';
                //pyjs_eval(onload_fn); /* set up the parent-module namespace */
            }
            return;
        }
        if (typeof (module_load_request[module_name]) == 'undefined')
        {
            module_load_request[module_name] = 1;
        }

        /* following a load, this first executes the script 
         * "preparation" function MODULENAME_loaded_fn()
         * and then sets up the loaded module in the namespace
         * of the parent.
         */

        onload_fn = ''; // module_name + "_loaded_fn();"

        if (parent_module != null)
        {
            //onload_fn += parent_module + '.' + module_name + ' = ' + module_name + ';';
            /*pmod = parent_module + '.' + module_name;
            onload_fn += 'alert("' + pmod + '"+' + pmod+');';*/
        }


        if (dynamic)
        {
            /* this one tacks the script onto the end of the DOM
             */

            pyjs_load_script(cache_file, onload_fn, async);

            /* this one actually RUNS the script (eval) into the page.
               my feeling is that this would be better for non-async
               but i can't get it to work entirely yet.
             */
            /*pyjs_ajax_eval(cache_file, onload_fn, async);*/
        }
        else
        {
            if (module_name != "pyjslib" &&
                module_name != "sys")
                pyjs_eval(onload_fn);
        }

    
	};
	pyjslib.import_module.__name__ = 'import_module';

	pyjslib.import_module.parse_kwargs = function ( __kwargs, path, parent_module, module_name, dynamic, async ) {
		if (typeof path == 'undefined') {
			path=__kwargs.path;
			delete __kwargs.path;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.path != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_module', 'path');
		}
		if (typeof parent_module == 'undefined') {
			parent_module=__kwargs.parent_module;
			delete __kwargs.parent_module;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.parent_module != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_module', 'parent_module');
		}
		if (typeof module_name == 'undefined') {
			module_name=__kwargs.module_name;
			delete __kwargs.module_name;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.module_name != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_module', 'module_name');
		}
		if (typeof dynamic == 'undefined') {
			dynamic=__kwargs.dynamic;
			delete __kwargs.dynamic;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.dynamic != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_module', 'dynamic');
		}
		if (typeof async == 'undefined') {
			async=__kwargs.async;
			delete __kwargs.async;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.async != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_module', 'async');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.import_module', i);
			}
		}
		var __r = [path, parent_module, module_name, dynamic, async];
		for (var pyjs__va_arg = 6;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=110;
	pyjslib.import_wait = function(proceed_fn, parent_mod, dynamic) {
		if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);


    var data = '';
    var element = $doc.createElement("div");
    $doc.body.appendChild(element);
    function write_dom(txt) {
        element.innerHTML = txt + '<br />';
    }

    var timeoutperiod = 1;
    if (dynamic)
        var timeoutperiod = 1;

    var wait = function() {

        var status = '';
        for (l in module_load_request)
        {
            var m = module_load_request[l];
            if (l == "sys" || l == 'pyjslib')
                continue;
            status += l + m + " ";
        }

        //write_dom( " import wait " + wait_count + " " + status + " parent_mod " + parent_mod);
        wait_count += 1;

        if (status == '')
        {
            setTimeout(wait, timeoutperiod);
            return;
        }

        for (l in module_load_request)
        {
            var m = module_load_request[l];
            if (l == "sys" || l == 'pyjslib')
            {
                module_load_request[l] = 4;
                continue;
            }
            if ((parent_mod != null) && (l == parent_mod))
            {
                if (m == 1)
                {
                    setTimeout(wait, timeoutperiod);
                    return;
                }
                if (m == 2)
                {
                    /* cheat and move app on to next stage */
                    module_load_request[l] = 3;
                }
            }
            if (m == 1 || m == 2)
            {
                setTimeout(wait, timeoutperiod);
                return;
            }
            if (m == 3)
            {
                //alert("waited for module " + l + ": loaded");
                module_load_request[l] = 4;
                mod_fn = modules[l];
            }
        }
        //alert("module wait done");

        if (proceed_fn.importDone)
            proceed_fn.importDone(proceed_fn);
        else
            proceed_fn();
    }

    wait();

	};
	pyjslib.import_wait.__name__ = 'import_wait';

	pyjslib.import_wait.parse_kwargs = function ( __kwargs, proceed_fn, parent_mod, dynamic ) {
		if (typeof proceed_fn == 'undefined') {
			proceed_fn=__kwargs.proceed_fn;
			delete __kwargs.proceed_fn;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.proceed_fn != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_wait', 'proceed_fn');
		}
		if (typeof parent_mod == 'undefined') {
			parent_mod=__kwargs.parent_mod;
			delete __kwargs.parent_mod;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.parent_mod != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_wait', 'parent_mod');
		}
		if (typeof dynamic == 'undefined') {
			dynamic=__kwargs.dynamic;
			delete __kwargs.dynamic;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.dynamic != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.import_wait', 'dynamic');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.import_wait', i);
			}
		}
		var __r = [proceed_fn, parent_mod, dynamic];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=188;
	pyjslib.object = (function(){
		var cls_instance = pyjs__class_instance('object');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'f5d5b97c1e8cae67745c5d7f8f5068b3';
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array());
	})();
	track.lineno=191;
	pyjslib.Object = pyjslib.object;
	track.lineno=193;
	pyjslib.Modload = (function(){
		var cls_instance = pyjs__class_instance('Modload');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'd8a3b79aeb207fc051143df848fd8ee8';
		cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(path, app_modlist, app_imported_fn, dynamic, parent_mod) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 5) pyjs__exception_func_param(arguments.callee.__name__, 6, 6, arguments.length+1);
			} else {
				var self = arguments[0];
				path = arguments[1];
				app_modlist = arguments[2];
				app_imported_fn = arguments[3];
				dynamic = arguments[4];
				parent_mod = arguments[5];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 6) pyjs__exception_func_param(arguments.callee.__name__, 6, 6, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'd8a3b79aeb207fc051143df848fd8ee8') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			self.app_modlist = app_modlist;
			self.app_imported_fn = app_imported_fn;
			self.path = path;
			self.idx = 0;
			self.dynamic = dynamic;
			self.parent_mod = parent_mod;
			return null;
		}
		, function ( __kwargs, path, app_modlist, app_imported_fn, dynamic, parent_mod ) {
			if (typeof path == 'undefined') {
				path=__kwargs.path;
				delete __kwargs.path;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.path != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'path');
			}
			if (typeof app_modlist == 'undefined') {
				app_modlist=__kwargs.app_modlist;
				delete __kwargs.app_modlist;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.app_modlist != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'app_modlist');
			}
			if (typeof app_imported_fn == 'undefined') {
				app_imported_fn=__kwargs.app_imported_fn;
				delete __kwargs.app_imported_fn;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.app_imported_fn != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'app_imported_fn');
			}
			if (typeof dynamic == 'undefined') {
				dynamic=__kwargs.dynamic;
				delete __kwargs.dynamic;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.dynamic != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'dynamic');
			}
			if (typeof parent_mod == 'undefined') {
				parent_mod=__kwargs.parent_mod;
				delete __kwargs.parent_mod;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.parent_mod != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'parent_mod');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__init__', i);
				}
			}
			var __r = [path, app_modlist, app_imported_fn, dynamic, parent_mod];
			for (var pyjs__va_arg = 6;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.next = pyjs__bind_method(cls_instance, 'next', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'd8a3b79aeb207fc051143df848fd8ee8') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			var __i = pyjslib.range(pyjslib.len((self.app_modlist===undefined?(function(){throw new TypeError('self.app_modlist is undefined')})():(typeof self.app_modlist == 'function' && self.__is_instance__?pyjslib.getattr(self, 'app_modlist'):self.app_modlist)).__getitem__((self.idx===undefined?(function(){throw new TypeError('self.idx is undefined')})():(typeof self.idx == 'function' && self.__is_instance__?pyjslib.getattr(self, 'idx'):self.idx))))).__iter__();
			try {
				while (true) {
					var i = __i.next();
					
					var app = (self.app_modlist===undefined?(function(){throw new TypeError('self.app_modlist is undefined')})():(typeof self.app_modlist == 'function' && self.__is_instance__?pyjslib.getattr(self, 'app_modlist'):self.app_modlist)).__getitem__((self.idx===undefined?(function(){throw new TypeError('self.idx is undefined')})():(typeof self.idx == 'function' && self.__is_instance__?pyjslib.getattr(self, 'idx'):self.idx))).__getitem__(i);
					pyjslib.import_module((self.path===undefined?(function(){throw new TypeError('self.path is undefined')})():(typeof self.path == 'function' && self.__is_instance__?pyjslib.getattr(self, 'path'):self.path)), (self.parent_mod===undefined?(function(){throw new TypeError('self.parent_mod is undefined')})():(typeof self.parent_mod == 'function' && self.__is_instance__?pyjslib.getattr(self, 'parent_mod'):self.parent_mod)), app, (self.dynamic===undefined?(function(){throw new TypeError('self.dynamic is undefined')})():(typeof self.dynamic == 'function' && self.__is_instance__?pyjslib.getattr(self, 'dynamic'):self.dynamic)), true);
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
			self.idx += 1;
			if (pyjslib.bool((pyjslib.cmp((self.idx===undefined?(function(){throw new TypeError('self.idx is undefined')})():(typeof self.idx == 'function' && self.__is_instance__?pyjslib.getattr(self, 'idx'):self.idx)), pyjslib.len((self.app_modlist===undefined?(function(){throw new TypeError('self.app_modlist is undefined')})():(typeof self.app_modlist == 'function' && self.__is_instance__?pyjslib.getattr(self, 'app_modlist'):self.app_modlist)))) != -1))) {
				pyjslib.import_wait((self.app_imported_fn===undefined?(function(){throw new TypeError('self.app_imported_fn is undefined')})():(typeof self.app_imported_fn == 'function' && self.__is_instance__?pyjslib.getattr(self, 'app_imported_fn'):self.app_imported_fn)), (self.parent_mod===undefined?(function(){throw new TypeError('self.parent_mod is undefined')})():(typeof self.parent_mod == 'function' && self.__is_instance__?pyjslib.getattr(self, 'parent_mod'):self.parent_mod)), (self.dynamic===undefined?(function(){throw new TypeError('self.dynamic is undefined')})():(typeof self.dynamic == 'function' && self.__is_instance__?pyjslib.getattr(self, 'dynamic'):self.dynamic)));
			}
			else {
				pyjslib.import_wait(pyjslib.getattr(self, String('next')), (self.parent_mod===undefined?(function(){throw new TypeError('self.parent_mod is undefined')})():(typeof self.parent_mod == 'function' && self.__is_instance__?pyjslib.getattr(self, 'parent_mod'):self.parent_mod)), (self.dynamic===undefined?(function(){throw new TypeError('self.dynamic is undefined')})():(typeof self.dynamic == 'function' && self.__is_instance__?pyjslib.getattr(self, 'dynamic'):self.dynamic)));
			}
			return null;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('next', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.object));
	})();
	track.lineno=218;
	pyjslib.get_module = function(module_name) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'pyjslib',lineno:218};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=218;
		track.lineno=219;
		var ev = pyjslib.sprintf(String('__mod = %s\x3B'), module_name);
		track.lineno=220;
pyjs_eval(ev);
		track.lineno=221;
		track.lineno=221;
		var pyjs__ret = __mod;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.get_module.__name__ = 'get_module';

	pyjslib.get_module.parse_kwargs = function ( __kwargs, module_name ) {
		if (typeof module_name == 'undefined') {
			module_name=__kwargs.module_name;
			delete __kwargs.module_name;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.module_name != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.get_module', 'module_name');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.get_module', i);
			}
		}
		var __r = [module_name];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=223;
	pyjslib.preload_app_modules = function(path, app_modnames, app_imported_fn, dynamic, parent_mod) {
		if (pyjs_options.arg_count && (arguments.length < 4 || arguments.length > 5)) pyjs__exception_func_param(arguments.callee.__name__, 4, 5, arguments.length);
		if (typeof parent_mod == 'undefined') parent_mod=null;
		track={module:'pyjslib',lineno:223};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=223;
		track.lineno=226;
		var loader = pyjslib.Modload(path, app_modnames, app_imported_fn, dynamic, parent_mod);
		track.lineno=227;
		loader.next();
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return null;
	};
	pyjslib.preload_app_modules.__name__ = 'preload_app_modules';

	pyjslib.preload_app_modules.parse_kwargs = function ( __kwargs, path, app_modnames, app_imported_fn, dynamic, parent_mod ) {
		if (typeof path == 'undefined') {
			path=__kwargs.path;
			delete __kwargs.path;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.path != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.preload_app_modules', 'path');
		}
		if (typeof app_modnames == 'undefined') {
			app_modnames=__kwargs.app_modnames;
			delete __kwargs.app_modnames;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.app_modnames != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.preload_app_modules', 'app_modnames');
		}
		if (typeof app_imported_fn == 'undefined') {
			app_imported_fn=__kwargs.app_imported_fn;
			delete __kwargs.app_imported_fn;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.app_imported_fn != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.preload_app_modules', 'app_imported_fn');
		}
		if (typeof dynamic == 'undefined') {
			dynamic=__kwargs.dynamic;
			delete __kwargs.dynamic;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.dynamic != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.preload_app_modules', 'dynamic');
		}
		if (typeof parent_mod == 'undefined') {
			parent_mod=__kwargs.parent_mod;
			delete __kwargs.parent_mod;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.parent_mod != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.preload_app_modules', 'parent_mod');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.preload_app_modules', i);
			}
		}
		var __r = [path, app_modnames, app_imported_fn, dynamic, parent_mod];
		for (var pyjs__va_arg = 6;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=229;
	modules['sys'] = sys();
	pyjslib.import_module(sys.loadpath, 'pyjslib', 'sys', 0, false);
	track.module='pyjslib';

	pyjslib.sys = sys;
	track.lineno=231;
	pyjslib.BaseException = (function(){
		var cls_instance = pyjs__class_instance('BaseException');
		var cls_definition = new Object();
		cls_definition.__md5__ = '6fc5441c9ca501de5c9c41874844c6fb';
		cls_definition.message = String('')
		cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				var args = pyjslib.Tuple();
				for (var pyjs__va_arg = 0; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
					var pyjs__arg = arguments[pyjs__va_arg];
					args.append(pyjs__arg);
				}
				if (pyjs_options.arg_count && arguments.length < 0) pyjs__exception_func_param(arguments.callee.__name__, 1, null, arguments.length+1);
			} else {
				var self = arguments[0];
				var args = pyjslib.Tuple();
				for (var pyjs__va_arg = 1; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
					var pyjs__arg = arguments[pyjs__va_arg];
					args.append(pyjs__arg);
				}
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length < 1) pyjs__exception_func_param(arguments.callee.__name__, 1, null, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '6fc5441c9ca501de5c9c41874844c6fb') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:235};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=235;
			track.lineno=236;
			self.args = args;
			track.lineno=237;
			if (pyjslib.bool(pyjslib.eq(pyjslib.len(args), 1))) {
				track.lineno=238;
				self.message = args.__getitem__(0);
			}
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return null;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__init__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '6fc5441c9ca501de5c9c41874844c6fb') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:240};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=240;
			track.lineno=241;
			if (pyjslib.bool((pyjslib.len((self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args))) === 0))) {
				track.lineno=242;
				track.lineno=242;
				var pyjs__ret = String('');
				trackstack.pop();track=trackstack.pop();trackstack.push(track);
				return pyjs__ret;
			}
			else if (pyjslib.bool((pyjslib.len((self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args))) === 1))) {
				track.lineno=244;
				track.lineno=244;
				var pyjs__ret = pyjslib.str((self.message===undefined?(function(){throw new TypeError('self.message is undefined')})():(typeof self.message == 'function' && self.__is_instance__?pyjslib.getattr(self, 'message'):self.message)));
				trackstack.pop();track=trackstack.pop();trackstack.push(track);
				return pyjs__ret;
			}
			track.lineno=245;
			track.lineno=245;
			var pyjs__ret = pyjslib.repr((self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args)));
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__str__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '6fc5441c9ca501de5c9c41874844c6fb') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:247};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=247;
			track.lineno=248;
			track.lineno=248;
			var pyjs__ret =  ( (self.__name__===undefined?(function(){throw new TypeError('self.__name__ is undefined')})():(typeof self.__name__ == 'function' && self.__is_instance__?pyjslib.getattr(self, '__name__'):self.__name__)) + pyjslib.repr((self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args))) ) ;
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__repr__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.toString = pyjs__bind_method(cls_instance, 'toString', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '6fc5441c9ca501de5c9c41874844c6fb') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:250};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=250;
			track.lineno=251;
			track.lineno=251;
			var pyjs__ret = pyjslib.str(self);
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('toString', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.object));
	})();
	track.lineno=253;
	pyjslib.Exception = (function(){
		var cls_instance = pyjs__class_instance('Exception');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'c130f58334ab6fcbadd72111964ad3f1';
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.BaseException));
	})();
	track.lineno=256;
	pyjslib.StandardError = (function(){
		var cls_instance = pyjs__class_instance('StandardError');
		var cls_definition = new Object();
		cls_definition.__md5__ = '3377ec933b775512da98ebb094335941';
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.Exception));
	})();
	track.lineno=259;
	pyjslib.TypeError = (function(){
		var cls_instance = pyjs__class_instance('TypeError');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'f98d02f35676442f9a053f295376f3db';
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.StandardError));
	})();
	track.lineno=262;
	pyjslib.LookupError = (function(){
		var cls_instance = pyjs__class_instance('LookupError');
		var cls_definition = new Object();
		cls_definition.__md5__ = '22f0cbb5b6166b6ad86723aad193ec71';
		cls_definition.toString = pyjs__bind_method(cls_instance, 'toString', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '22f0cbb5b6166b6ad86723aad193ec71') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:264};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=264;
			track.lineno=265;
			track.lineno=265;
			var pyjs__ret =  (  ( (self.__name__===undefined?(function(){throw new TypeError('self.__name__ is undefined')})():(typeof self.__name__ == 'function' && self.__is_instance__?pyjslib.getattr(self, '__name__'):self.__name__)) + String(': ') )  + (self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args)).__getitem__(0) ) ;
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('toString', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.StandardError));
	})();
	track.lineno=267;
	pyjslib.KeyError = (function(){
		var cls_instance = pyjs__class_instance('KeyError');
		var cls_definition = new Object();
		cls_definition.__md5__ = '20522047291df89f351ad575cc99687b';
		cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '20522047291df89f351ad575cc99687b') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:269};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=269;
			track.lineno=270;
			if (pyjslib.bool((pyjslib.len((self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args))) === 0))) {
				track.lineno=271;
				track.lineno=271;
				var pyjs__ret = String('');
				trackstack.pop();track=trackstack.pop();trackstack.push(track);
				return pyjs__ret;
			}
			else if (pyjslib.bool((pyjslib.len((self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args))) === 1))) {
				track.lineno=273;
				track.lineno=273;
				var pyjs__ret = pyjslib.repr((self.message===undefined?(function(){throw new TypeError('self.message is undefined')})():(typeof self.message == 'function' && self.__is_instance__?pyjslib.getattr(self, 'message'):self.message)));
				trackstack.pop();track=trackstack.pop();trackstack.push(track);
				return pyjs__ret;
			}
			track.lineno=274;
			track.lineno=274;
			var pyjs__ret = pyjslib.repr((self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args)));
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__str__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.LookupError));
	})();
	track.lineno=276;
	pyjslib.AttributeError = (function(){
		var cls_instance = pyjs__class_instance('AttributeError');
		var cls_definition = new Object();
		cls_definition.__md5__ = '3ed24a64e3e36737f6c25e0508309915';
		cls_definition.toString = pyjs__bind_method(cls_instance, 'toString', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '3ed24a64e3e36737f6c25e0508309915') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:278};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=278;
			track.lineno=279;
			track.lineno=279;
			var pyjs__ret = pyjslib.sprintf(String('AttributeError: %s of %s'), new pyjslib.Tuple([(self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args)).__getitem__(1), (self.args===undefined?(function(){throw new TypeError('self.args is undefined')})():(typeof self.args == 'function' && self.__is_instance__?pyjslib.getattr(self, 'args'):self.args)).__getitem__(0)]));
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('toString', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.StandardError));
	})();
	track.lineno=281;
	pyjslib.NameError = (function(){
		var cls_instance = pyjs__class_instance('NameError');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'de57b8f49b0ed2448ff4ea4085392466';
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.StandardError));
	})();
	track.lineno=284;
	pyjslib.ValueError = (function(){
		var cls_instance = pyjs__class_instance('ValueError');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'bb48fd9d3648265c609ec1b7360de294';
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.StandardError));
	})();
	track.lineno=287;
	pyjslib.IndexError = (function(){
		var cls_instance = pyjs__class_instance('IndexError');
		var cls_definition = new Object();
		cls_definition.__md5__ = '2be1d453e67f2382f948d133f5bcf2c3';
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.LookupError));
	})();
	track.lineno=505;

pyjslib._errorMapping = function(err) {
    if (err instanceof(ReferenceError) || err instanceof(TypeError)) {
        var message = ''
        try {
            message = err.message;
        } catch ( e) {
        }
        return pyjslib.AttributeError(message);
    }
    return err
}

pyjslib.TryElse = function () { };
pyjslib.TryElse.prototype = new Error();
pyjslib.TryElse.__name__ = 'TryElse';
pyjslib.TryElse.message = 'TryElse';

pyjslib.StopIteration = function () { };
pyjslib.StopIteration.prototype = new Error();
pyjslib.StopIteration.__name__ = 'StopIteration';
pyjslib.StopIteration.message = 'StopIteration';

pyjslib.String_find = function(sub, start, end) {
    var pos=this.indexOf(sub, start);
    if (pyjslib.isUndefined(end)) return pos;

    if (pos + sub.length>end) return -1;
    return pos;
}

pyjslib.String_join = function(data) {
    var text="";

    if (pyjslib.isArray(data)) {
        return data.join(this);
    }
    else if (pyjslib.isIteratable(data)) {
        var iter=data.__iter__();
        try {
            text+=iter.next();
            while (true) {
                var item=iter.next();
                text+=this + item;
            }
        }
        catch (e) {
            if (e.__name__ != 'StopIteration') throw e;
        }
    }

    return text;
}

pyjslib.String_isdigit = function() {
    return (this.match(/^\d+$/g) != null);
}

pyjslib.String_replace = function(old, replace, count) {
    var do_max=false;
    var start=0;
    var new_str="";
    var pos=0;

    if (!pyjslib.isString(old)) return this.__replace(old, replace);
    if (!pyjslib.isUndefined(count)) do_max=true;

    while (start<this.length) {
        if (do_max && !count--) break;

        pos=this.indexOf(old, start);
        if (pos<0) break;

        new_str+=this.substring(start, pos) + replace;
        start=pos+old.length;
    }
    if (start<this.length) new_str+=this.substring(start);

    return new_str;
}

pyjslib.String_split = function(sep, maxsplit) {
    var items=new pyjslib.List();
    var do_max=false;
    var subject=this;
    var start=0;
    var pos=0;

    if (pyjslib.isUndefined(sep) || pyjslib.isNull(sep)) {
        sep=" ";
        subject=subject.strip();
        subject=subject.replace(/\s+/g, sep);
    }
    else if (!pyjslib.isUndefined(maxsplit)) do_max=true;

    if (subject.length == 0) {
        return items;
    }

    while (start<subject.length) {
        if (do_max && !maxsplit--) break;

        pos=subject.indexOf(sep, start);
        if (pos<0) break;

        items.append(subject.substring(start, pos));
        start=pos+sep.length;
    }
    if (start<=subject.length) items.append(subject.substring(start));

    return items;
}

pyjslib.String___iter__ = function() {
    var i = 0;
    var s = this;
    return {
        'next': function() {
            if (i >= s.length) {
                throw pyjslib.StopIteration;
            }
            return s.substring(i++, i, 1);
        },
        '__iter__': function() {
            return this;
        }
    };
}

pyjslib.String_strip = function(chars) {
    return this.lstrip(chars).rstrip(chars);
}

pyjslib.String_lstrip = function(chars) {
    if (pyjslib.isUndefined(chars)) return this.replace(/^\s+/, "");

    return this.replace(new RegExp("^[" + chars + "]+"), "");
}

pyjslib.String_rstrip = function(chars) {
    if (pyjslib.isUndefined(chars)) return this.replace(/\s+$/, "");

    return this.replace(new RegExp("[" + chars + "]+$"), "");
}

pyjslib.String_startswith = function(prefix, start, end) {
    // FIXME: accept tuples as suffix (since 2.5)
    if (pyjslib.isUndefined(start)) start = 0;
    if (pyjslib.isUndefined(end)) end = this.length;

    if ((end - start) < prefix.length) return false
    if (this.substr(start, prefix.length) == prefix) return true;
    return false;
}

pyjslib.String_endswith = function(suffix, start, end) {
    // FIXME: accept tuples as suffix (since 2.5)
    if (pyjslib.isUndefined(start)) start = 0;
    if (pyjslib.isUndefined(end)) end = this.length;

    if ((end - start) < suffix.length) return false
    if (this.substr(end - suffix.length, suffix.length) == suffix) return true;
    return false;
}

pyjslib.String_ljust = function(width, fillchar) {
    if (typeof(width) != 'number' ||
        parseInt(width) != width) {
        throw (pyjslib.TypeError("an integer is required"));
    }
    if (pyjslib.isUndefined(fillchar)) fillchar = ' ';
    if (typeof(fillchar) != 'string' ||
        fillchar.length != 1) {
        throw (pyjslib.TypeError("ljust() argument 2 must be char, not " + typeof(fillchar)));
    }
    if (this.length >= width) return this;
    return this + new Array(width+1 - this.length).join(fillchar);
}

pyjslib.String_rjust = function(width, fillchar) {
    if (typeof(width) != 'number' ||
        parseInt(width) != width) {
        throw (pyjslib.TypeError("an integer is required"));
    }
    if (pyjslib.isUndefined(fillchar)) fillchar = ' ';
    if (typeof(fillchar) != 'string' ||
        fillchar.length != 1) {
        throw (pyjslib.TypeError("rjust() argument 2 must be char, not " + typeof(fillchar)));
    }
    if (this.length >= width) return this;
    return new Array(width + 1 - this.length).join(fillchar) + this;
}

pyjslib.String_center = function(width, fillchar) {
    if (typeof(width) != 'number' ||
        parseInt(width) != width) {
        throw (pyjslib.TypeError("an integer is required"));
    }
    if (pyjslib.isUndefined(fillchar)) fillchar = ' ';
    if (typeof(fillchar) != 'string' ||
        fillchar.length != 1) {
        throw (pyjslib.TypeError("center() argument 2 must be char, not " + typeof(fillchar)));
    }
    if (this.length >= width) return this;
    padlen = width - this.length
    right = Math.ceil(padlen / 2);
    left = padlen - right;
    return new Array(left+1).join(fillchar) + this + new Array(right+1).join(fillchar);
}

pyjslib.abs = Math.abs;


	track.lineno=507;
	pyjslib.Class = (function(){
		var cls_instance = pyjs__class_instance('Class');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'e4df5dc275adc4d87bf294e2b3abc47a';
		cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(name) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				name = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'e4df5dc275adc4d87bf294e2b3abc47a') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:508};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=508;
			track.lineno=509;
			self.name_ = name;
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return null;
		}
		, function ( __kwargs, name ) {
			if (typeof name == 'undefined') {
				name=__kwargs.name;
				delete __kwargs.name;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.name != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'name');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__init__', i);
				}
			}
			var __r = [name];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__str___ = pyjs__bind_method(cls_instance, '__str___', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'e4df5dc275adc4d87bf294e2b3abc47a') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			track={module:pyjslib, lineno:511};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=511;
			track.lineno=512;
			track.lineno=512;
			var pyjs__ret = (self.name_===undefined?(function(){throw new TypeError('self.name_ is undefined')})():(typeof self.name_ == 'function' && self.__is_instance__?pyjslib.getattr(self, 'name_'):self.name_));
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__str___', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.object));
	})();
	track.lineno=515;
	pyjslib.eq = function(a, b) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);

    if (a === null) {
        if (b === null) return true;
        return false;
    }
    if (b === null) {
        return false;
    }
    if ((typeof a == 'object' || typeof a == 'function') && typeof a.__cmp__ == 'function') {
        return a.__cmp__(b) == 0;
    } else if ((typeof b == 'object' || typeof b == 'function') && typeof b.__cmp__ == 'function') {
        return b.__cmp__(a) == 0;
    }
    return a == b;
    
	};
	pyjslib.eq.__name__ = 'eq';

	pyjslib.eq.parse_kwargs = function ( __kwargs, a, b ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.eq', 'a');
		}
		if (typeof b == 'undefined') {
			b=__kwargs.b;
			delete __kwargs.b;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.eq', 'b');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.eq', i);
			}
		}
		var __r = [a, b];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=536;
	pyjslib.cmp = function(a, b) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);

    if (a === null) {
        if (b === null) return 0;
        return -1;
    }
    if (b === null) {
        return 1;
    }
    if ((typeof a == 'object' || typeof a == 'function') && typeof a.__cmp__ == 'function') {
        return a.__cmp__(b);
    } else if ((typeof b == 'object' || typeof b == 'function') && typeof b.__cmp__ == 'function') {
        return -b.__cmp__(a);
    }
    if (a > b) return 1;
    if (b > a) return -1;
    return 0;
    
	};
	pyjslib.cmp.__name__ = 'cmp';

	pyjslib.cmp.parse_kwargs = function ( __kwargs, a, b ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.cmp', 'a');
		}
		if (typeof b == 'undefined') {
			b=__kwargs.b;
			delete __kwargs.b;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.cmp', 'b');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.cmp', i);
			}
		}
		var __r = [a, b];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=556;
	pyjslib.bool = function(v) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    if (!v) return false;
    switch(typeof v){
    case 'boolean':
        return v;
    case 'object':
        if (v.__nonzero__){
            return v.__nonzero__();
        }else if (v.__len__){
            return v.__len__()>0;
        }
        return true;
    }
    return Boolean(v);
    
	};
	pyjslib.bool.__name__ = 'bool';

	pyjslib.bool.parse_kwargs = function ( __kwargs, v ) {
		if (typeof v == 'undefined') {
			v=__kwargs.v;
			delete __kwargs.v;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.v != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.bool', 'v');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.bool', i);
			}
		}
		var __r = [v];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=576;
	pyjslib.List = (function(){
		var cls_instance = pyjs__class_instance('List');
		var cls_definition = new Object();
		cls_definition.__md5__ = '738175b0431fec1aa90312cefbe2bae4';
		cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(data) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 1)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				data = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof data == 'undefined') data=null;

        this.l = [];
        this.extend(data);
        
		}
		, function ( __kwargs, data ) {
			if (typeof data == 'undefined') {
				data=__kwargs.data;
				delete __kwargs.data;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.data != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'data');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__init__', i);
				}
			}
			var __r = [data];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.append = pyjs__bind_method(cls_instance, 'append', function(item) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				item = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l[this.l.length] = item;
		}
		, function ( __kwargs, item ) {
			if (typeof item == 'undefined') {
				item=__kwargs.item;
				delete __kwargs.item;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.item != 'undefined') {
				pyjs__exception_func_multiple_values('append', 'item');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('append', i);
				}
			}
			var __r = [item];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.extend = pyjs__bind_method(cls_instance, 'extend', function(data) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				data = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        if (pyjslib.isArray(data)) {
            n = this.l.length;
            for (var i=0; i < data.length; i++) {
                this.l[n+i]=data[i];
                }
            }
        else if (pyjslib.isIteratable(data)) {
            var iter=data.__iter__();
            var i=this.l.length;
            try {
                while (true) {
                    var item=iter.next();
                    this.l[i++]=item;
                    }
                }
            catch (e) {
                if (e.__name__ != 'StopIteration') throw e;
                }
            }
        
		}
		, function ( __kwargs, data ) {
			if (typeof data == 'undefined') {
				data=__kwargs.data;
				delete __kwargs.data;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.data != 'undefined') {
				pyjs__exception_func_multiple_values('extend', 'data');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('extend', i);
				}
			}
			var __r = [data];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				value = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var index=this.index(value);
        if (index<0) return false;
        this.l.splice(index, 1);
        return true;
        
		}
		, function ( __kwargs, value ) {
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('remove', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('remove', i);
				}
			}
			var __r = [value];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.index = pyjs__bind_method(cls_instance, 'index', function(value, start) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				value = arguments[1];
				start = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 2 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof start == 'undefined') start=0;

        var length=this.l.length;
        for (var i=start; i<length; i++) {
            if (this.l[i]==value) {
                return i;
                }
            }
        return -1;
        
		}
		, function ( __kwargs, value, start ) {
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('index', 'value');
			}
			if (typeof start == 'undefined') {
				start=__kwargs.start;
				delete __kwargs.start;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.start != 'undefined') {
				pyjs__exception_func_multiple_values('index', 'start');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('index', i);
				}
			}
			var __r = [value, start];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(index, value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				value = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    var a = this.l; this.l=a.slice(0, index).concat(value, a.slice(index));
		}
		, function ( __kwargs, index, value ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('insert', 'index');
			}
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('insert', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('insert', i);
				}
			}
			var __r = [index, value];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.pop = pyjs__bind_method(cls_instance, 'pop', function(index) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 1)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof index == 'undefined') index=-1;

        if (index<0) index = this.l.length + index;
        var a = this.l[index];
        this.l.splice(index, 1);
        return a;
        
		}
		, function ( __kwargs, index ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('pop', 'index');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('pop', i);
				}
			}
			var __r = [index];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__cmp__ = pyjs__bind_method(cls_instance, '__cmp__', function(l) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				l = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (pyjslib.bool(!(pyjslib.isinstance(l, pyjslib.List)))) {
				return -1;
			}
			var ll =  ( pyjslib.len(self) - pyjslib.len(l) ) ;
			if (pyjslib.bool((ll != 0))) {
				return ll;
			}
			var __x = pyjslib.range(pyjslib.len(l)).__iter__();
			try {
				while (true) {
					var x = __x.next();
					
					ll = pyjslib.cmp(self.__getitem__(x), l.__getitem__(x));
					if (pyjslib.bool((ll != 0))) {
						return ll;
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
			return 0;
		}
		, function ( __kwargs, l ) {
			if (typeof l == 'undefined') {
				l=__kwargs.l;
				delete __kwargs.l;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.l != 'undefined') {
				pyjs__exception_func_multiple_values('__cmp__', 'l');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__cmp__', i);
				}
			}
			var __r = [l];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.slice = pyjs__bind_method(cls_instance, 'slice', function(lower, upper) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				lower = arguments[1];
				upper = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        if (upper==null) return pyjslib.List(this.l.slice(lower));
        return pyjslib.List(this.l.slice(lower, upper));
        
		}
		, function ( __kwargs, lower, upper ) {
			if (typeof lower == 'undefined') {
				lower=__kwargs.lower;
				delete __kwargs.lower;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.lower != 'undefined') {
				pyjs__exception_func_multiple_values('slice', 'lower');
			}
			if (typeof upper == 'undefined') {
				upper=__kwargs.upper;
				delete __kwargs.upper;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.upper != 'undefined') {
				pyjs__exception_func_multiple_values('slice', 'upper');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('slice', i);
				}
			}
			var __r = [lower, upper];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__getitem__ = pyjs__bind_method(cls_instance, '__getitem__', function(index) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        if (index<0) index = this.l.length + index;
        return this.l[index];
        
		}
		, function ( __kwargs, index ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('__getitem__', 'index');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__getitem__', i);
				}
			}
			var __r = [index];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__setitem__ = pyjs__bind_method(cls_instance, '__setitem__', function(index, value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				value = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l[index]=value;
		}
		, function ( __kwargs, index, value ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('__setitem__', 'index');
			}
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('__setitem__', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__setitem__', i);
				}
			}
			var __r = [index, value];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__delitem__ = pyjs__bind_method(cls_instance, '__delitem__', function(index) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l.splice(index, 1);
		}
		, function ( __kwargs, index ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('__delitem__', 'index');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__delitem__', i);
				}
			}
			var __r = [index];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__len__ = pyjs__bind_method(cls_instance, '__len__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    return this.l.length;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__len__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__contains__ = pyjs__bind_method(cls_instance, '__contains__', function(value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				value = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return (pyjslib.cmp(self.index(value), 0) != -1);
		}
		, function ( __kwargs, value ) {
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('__contains__', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__contains__', i);
				}
			}
			var __r = [value];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var i = 0;
        var l = this.l;
        return {
            'next': function() {
                if (i >= l.length) {
                    throw pyjslib.StopIteration;
                }
                return l[i++];
            },
            '__iter__': function() {
                return this;
            }
        };
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__iter__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.reverse = pyjs__bind_method(cls_instance, 'reverse', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l.reverse();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('reverse', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.sort = pyjs__bind_method(cls_instance, 'sort', function(compareFunc, keyFunc, reverse) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 1, 4, arguments.length+1);
			} else {
				var self = arguments[0];
				compareFunc = arguments[1];
				keyFunc = arguments[2];
				reverse = arguments[3];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 4)) pyjs__exception_func_param(arguments.callee.__name__, 1, 4, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof compareFunc == 'undefined') compareFunc=null;
			if (typeof keyFunc == 'undefined') keyFunc=null;
			if (typeof reverse == 'undefined') reverse=false;
			track={module:pyjslib, lineno:711};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=711;
			track.lineno=712;
			if (pyjslib.bool(!(compareFunc))) {
				track.lineno=713;
				track.lineno=714;
				compareFunc = pyjslib.cmp;
			}
			track.lineno=715;
			if (pyjslib.bool((keyFunc) && (reverse))) {
				track.lineno=716;
				thisSort1 = function(a, b) {
					if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
					track={module:'pyjslib',lineno:716};trackstack.push(track);
					track.module='pyjslib';
					track.lineno=716;
					track.lineno=717;
					track.lineno=717;
					var pyjs__ret = -compareFunc(keyFunc(a), keyFunc(b));
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				};
				thisSort1.__name__ = 'thisSort1';

				thisSort1.parse_kwargs = function ( __kwargs, a, b ) {
					if (typeof a == 'undefined') {
						a=__kwargs.a;
						delete __kwargs.a;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort1', 'a');
					}
					if (typeof b == 'undefined') {
						b=__kwargs.b;
						delete __kwargs.b;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort1', 'b');
					}
					if (pyjs_options.arg_kwarg_unexpected_keyword) {
						for (var i in __kwargs) {
							pyjs__exception_func_unexpected_keyword('thisSort1', i);
						}
					}
					var __r = [a, b];
					for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
						__r.push(arguments[pyjs__va_arg]);
					}

					return __r;
				};
				track.lineno=718;
				self.l.sort(thisSort1);
			}
			else if (pyjslib.bool(keyFunc)) {
				track.lineno=720;
				thisSort2 = function(a, b) {
					if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
					track={module:'pyjslib',lineno:720};trackstack.push(track);
					track.module='pyjslib';
					track.lineno=720;
					track.lineno=721;
					track.lineno=721;
					var pyjs__ret = compareFunc(keyFunc(a), keyFunc(b));
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				};
				thisSort2.__name__ = 'thisSort2';

				thisSort2.parse_kwargs = function ( __kwargs, a, b ) {
					if (typeof a == 'undefined') {
						a=__kwargs.a;
						delete __kwargs.a;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort2', 'a');
					}
					if (typeof b == 'undefined') {
						b=__kwargs.b;
						delete __kwargs.b;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort2', 'b');
					}
					if (pyjs_options.arg_kwarg_unexpected_keyword) {
						for (var i in __kwargs) {
							pyjs__exception_func_unexpected_keyword('thisSort2', i);
						}
					}
					var __r = [a, b];
					for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
						__r.push(arguments[pyjs__va_arg]);
					}

					return __r;
				};
				track.lineno=722;
				self.l.sort(thisSort2);
			}
			else if (pyjslib.bool(reverse)) {
				track.lineno=724;
				thisSort3 = function(a, b) {
					if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
					track={module:'pyjslib',lineno:724};trackstack.push(track);
					track.module='pyjslib';
					track.lineno=724;
					track.lineno=725;
					track.lineno=725;
					var pyjs__ret = -compareFunc(a, b);
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				};
				thisSort3.__name__ = 'thisSort3';

				thisSort3.parse_kwargs = function ( __kwargs, a, b ) {
					if (typeof a == 'undefined') {
						a=__kwargs.a;
						delete __kwargs.a;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort3', 'a');
					}
					if (typeof b == 'undefined') {
						b=__kwargs.b;
						delete __kwargs.b;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort3', 'b');
					}
					if (pyjs_options.arg_kwarg_unexpected_keyword) {
						for (var i in __kwargs) {
							pyjs__exception_func_unexpected_keyword('thisSort3', i);
						}
					}
					var __r = [a, b];
					for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
						__r.push(arguments[pyjs__va_arg]);
					}

					return __r;
				};
				track.lineno=726;
				self.l.sort(thisSort3);
			}
			else {
				track.lineno=728;
				self.l.sort(compareFunc);
			}
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return null;
		}
		, function ( __kwargs, compareFunc, keyFunc, reverse ) {
			if (typeof compareFunc == 'undefined') {
				compareFunc=__kwargs.compareFunc;
				delete __kwargs.compareFunc;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.compareFunc != 'undefined') {
				pyjs__exception_func_multiple_values('sort', 'compareFunc');
			}
			if (typeof keyFunc == 'undefined') {
				keyFunc=__kwargs.keyFunc;
				delete __kwargs.keyFunc;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.keyFunc != 'undefined') {
				pyjs__exception_func_multiple_values('sort', 'keyFunc');
			}
			if (typeof reverse == 'undefined') {
				reverse=__kwargs.reverse;
				delete __kwargs.reverse;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.reverse != 'undefined') {
				pyjs__exception_func_multiple_values('sort', 'reverse');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('sort', i);
				}
			}
			var __r = [compareFunc, keyFunc, reverse];
			for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.getArray = pyjs__bind_method(cls_instance, 'getArray', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return (self.l===undefined?(function(){throw new TypeError('self.l is undefined')})():(typeof self.l == 'function' && self.__is_instance__?pyjslib.getattr(self, 'l'):self.l));
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('getArray', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__repr__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__str__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.toString = pyjs__bind_method(cls_instance, 'toString', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__repr__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('toString', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '738175b0431fec1aa90312cefbe2bae4') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var s = "[";
        for (var i=0; i < self.l.length; i++) {
            s += pyjslib.repr(self.l[i]);
            if (i < self.l.length - 1)
                s += ", ";
        };
        s += "]"
        return s;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__repr__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.object));
	})();
	track.lineno=761;
	pyjslib.list = pyjslib.List;
	track.lineno=763;
	pyjslib.Tuple = (function(){
		var cls_instance = pyjs__class_instance('Tuple');
		var cls_definition = new Object();
		cls_definition.__md5__ = 'f9ccde39f155958204612cb792195f02';
		cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(data) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 1)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				data = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof data == 'undefined') data=null;

        this.l = [];
        this.extend(data);
        
		}
		, function ( __kwargs, data ) {
			if (typeof data == 'undefined') {
				data=__kwargs.data;
				delete __kwargs.data;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.data != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'data');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__init__', i);
				}
			}
			var __r = [data];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.append = pyjs__bind_method(cls_instance, 'append', function(item) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				item = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l[this.l.length] = item;
		}
		, function ( __kwargs, item ) {
			if (typeof item == 'undefined') {
				item=__kwargs.item;
				delete __kwargs.item;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.item != 'undefined') {
				pyjs__exception_func_multiple_values('append', 'item');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('append', i);
				}
			}
			var __r = [item];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.extend = pyjs__bind_method(cls_instance, 'extend', function(data) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				data = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        if (pyjslib.isArray(data)) {
            n = this.l.length;
            for (var i=0; i < data.length; i++) {
                this.l[n+i]=data[i];
                }
            }
        else if (pyjslib.isIteratable(data)) {
            var iter=data.__iter__();
            var i=this.l.length;
            try {
                while (true) {
                    var item=iter.next();
                    this.l[i++]=item;
                    }
                }
            catch (e) {
                if (e.__name__ != 'StopIteration') throw e;
                }
            }
        
		}
		, function ( __kwargs, data ) {
			if (typeof data == 'undefined') {
				data=__kwargs.data;
				delete __kwargs.data;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.data != 'undefined') {
				pyjs__exception_func_multiple_values('extend', 'data');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('extend', i);
				}
			}
			var __r = [data];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__hash__ = pyjs__bind_method(cls_instance, '__hash__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var strbuf=[];
        for(var i=0; i<this.l.length; i++){
            strbuf.push(pyjslib.hash(this.l[i]))
        }
        return 'tuple('+strbuf.join(',')+')'
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__hash__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.remove = pyjs__bind_method(cls_instance, 'remove', function(value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				value = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var index=this.index(value);
        if (index<0) return false;
        this.l.splice(index, 1);
        return true;
        
		}
		, function ( __kwargs, value ) {
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('remove', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('remove', i);
				}
			}
			var __r = [value];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.index = pyjs__bind_method(cls_instance, 'index', function(value, start) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				value = arguments[1];
				start = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 2 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof start == 'undefined') start=0;

        var length=this.l.length;
        for (var i=start; i<length; i++) {
            if (this.l[i]==value) {
                return i;
                }
            }
        return -1;
        
		}
		, function ( __kwargs, value, start ) {
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('index', 'value');
			}
			if (typeof start == 'undefined') {
				start=__kwargs.start;
				delete __kwargs.start;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.start != 'undefined') {
				pyjs__exception_func_multiple_values('index', 'start');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('index', i);
				}
			}
			var __r = [value, start];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.insert = pyjs__bind_method(cls_instance, 'insert', function(index, value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				value = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    var a = this.l; this.l=a.slice(0, index).concat(value, a.slice(index));
		}
		, function ( __kwargs, index, value ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('insert', 'index');
			}
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('insert', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('insert', i);
				}
			}
			var __r = [index, value];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.pop = pyjs__bind_method(cls_instance, 'pop', function(index) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 1)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof index == 'undefined') index=-1;

        if (index<0) index = this.l.length + index;
        var a = this.l[index];
        this.l.splice(index, 1);
        return a;
        
		}
		, function ( __kwargs, index ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('pop', 'index');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('pop', i);
				}
			}
			var __r = [index];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__cmp__ = pyjs__bind_method(cls_instance, '__cmp__', function(l) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				l = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (pyjslib.bool(!(pyjslib.isinstance(l, pyjslib.Tuple)))) {
				return 1;
			}
			var ll =  ( pyjslib.len(self) - pyjslib.len(l) ) ;
			if (pyjslib.bool((ll != 0))) {
				return ll;
			}
			var __x = pyjslib.range(pyjslib.len(l)).__iter__();
			try {
				while (true) {
					var x = __x.next();
					
					ll = pyjslib.cmp(self.__getitem__(x), l.__getitem__(x));
					if (pyjslib.bool((ll != 0))) {
						return ll;
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
			return 0;
		}
		, function ( __kwargs, l ) {
			if (typeof l == 'undefined') {
				l=__kwargs.l;
				delete __kwargs.l;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.l != 'undefined') {
				pyjs__exception_func_multiple_values('__cmp__', 'l');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__cmp__', i);
				}
			}
			var __r = [l];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.slice = pyjs__bind_method(cls_instance, 'slice', function(lower, upper) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				lower = arguments[1];
				upper = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        if (upper==null) return pyjslib.Tuple(this.l.slice(lower));
        return pyjslib.Tuple(this.l.slice(lower, upper));
        
		}
		, function ( __kwargs, lower, upper ) {
			if (typeof lower == 'undefined') {
				lower=__kwargs.lower;
				delete __kwargs.lower;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.lower != 'undefined') {
				pyjs__exception_func_multiple_values('slice', 'lower');
			}
			if (typeof upper == 'undefined') {
				upper=__kwargs.upper;
				delete __kwargs.upper;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.upper != 'undefined') {
				pyjs__exception_func_multiple_values('slice', 'upper');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('slice', i);
				}
			}
			var __r = [lower, upper];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__getitem__ = pyjs__bind_method(cls_instance, '__getitem__', function(index) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        if (index<0) index = this.l.length + index;
        return this.l[index];
        
		}
		, function ( __kwargs, index ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('__getitem__', 'index');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__getitem__', i);
				}
			}
			var __r = [index];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__setitem__ = pyjs__bind_method(cls_instance, '__setitem__', function(index, value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				value = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l[index]=value;
		}
		, function ( __kwargs, index, value ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('__setitem__', 'index');
			}
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('__setitem__', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__setitem__', i);
				}
			}
			var __r = [index, value];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__delitem__ = pyjs__bind_method(cls_instance, '__delitem__', function(index) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				index = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l.splice(index, 1);
		}
		, function ( __kwargs, index ) {
			if (typeof index == 'undefined') {
				index=__kwargs.index;
				delete __kwargs.index;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.index != 'undefined') {
				pyjs__exception_func_multiple_values('__delitem__', 'index');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__delitem__', i);
				}
			}
			var __r = [index];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__len__ = pyjs__bind_method(cls_instance, '__len__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    return this.l.length;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__len__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__contains__ = pyjs__bind_method(cls_instance, '__contains__', function(value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				value = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return (pyjslib.cmp(self.index(value), 0) != -1);
		}
		, function ( __kwargs, value ) {
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('__contains__', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__contains__', i);
				}
			}
			var __r = [value];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var i = 0;
        var l = this.l;
        return {
            'next': function() {
                if (i >= l.length) {
                    throw pyjslib.StopIteration;
                }
                return l[i++];
            },
            '__iter__': function() {
                return this;
            }
        };
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__iter__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.reverse = pyjs__bind_method(cls_instance, 'reverse', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
    this.l.reverse();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('reverse', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.sort = pyjs__bind_method(cls_instance, 'sort', function(compareFunc, keyFunc, reverse) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 1, 4, arguments.length+1);
			} else {
				var self = arguments[0];
				compareFunc = arguments[1];
				keyFunc = arguments[2];
				reverse = arguments[3];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 4)) pyjs__exception_func_param(arguments.callee.__name__, 1, 4, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof compareFunc == 'undefined') compareFunc=null;
			if (typeof keyFunc == 'undefined') keyFunc=null;
			if (typeof reverse == 'undefined') reverse=false;
			track={module:pyjslib, lineno:908};trackstack.push(track);
			track.module='pyjslib';
			track.lineno=908;
			track.lineno=909;
			if (pyjslib.bool(!(compareFunc))) {
				track.lineno=910;
				track.lineno=911;
				compareFunc = pyjslib.cmp;
			}
			track.lineno=912;
			if (pyjslib.bool((keyFunc) && (reverse))) {
				track.lineno=913;
				thisSort1 = function(a, b) {
					if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
					track={module:'pyjslib',lineno:913};trackstack.push(track);
					track.module='pyjslib';
					track.lineno=913;
					track.lineno=914;
					track.lineno=914;
					var pyjs__ret = -compareFunc(keyFunc(a), keyFunc(b));
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				};
				thisSort1.__name__ = 'thisSort1';

				thisSort1.parse_kwargs = function ( __kwargs, a, b ) {
					if (typeof a == 'undefined') {
						a=__kwargs.a;
						delete __kwargs.a;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort1', 'a');
					}
					if (typeof b == 'undefined') {
						b=__kwargs.b;
						delete __kwargs.b;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort1', 'b');
					}
					if (pyjs_options.arg_kwarg_unexpected_keyword) {
						for (var i in __kwargs) {
							pyjs__exception_func_unexpected_keyword('thisSort1', i);
						}
					}
					var __r = [a, b];
					for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
						__r.push(arguments[pyjs__va_arg]);
					}

					return __r;
				};
				track.lineno=915;
				self.l.sort(thisSort1);
			}
			else if (pyjslib.bool(keyFunc)) {
				track.lineno=917;
				thisSort2 = function(a, b) {
					if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
					track={module:'pyjslib',lineno:917};trackstack.push(track);
					track.module='pyjslib';
					track.lineno=917;
					track.lineno=918;
					track.lineno=918;
					var pyjs__ret = compareFunc(keyFunc(a), keyFunc(b));
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				};
				thisSort2.__name__ = 'thisSort2';

				thisSort2.parse_kwargs = function ( __kwargs, a, b ) {
					if (typeof a == 'undefined') {
						a=__kwargs.a;
						delete __kwargs.a;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort2', 'a');
					}
					if (typeof b == 'undefined') {
						b=__kwargs.b;
						delete __kwargs.b;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort2', 'b');
					}
					if (pyjs_options.arg_kwarg_unexpected_keyword) {
						for (var i in __kwargs) {
							pyjs__exception_func_unexpected_keyword('thisSort2', i);
						}
					}
					var __r = [a, b];
					for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
						__r.push(arguments[pyjs__va_arg]);
					}

					return __r;
				};
				track.lineno=919;
				self.l.sort(thisSort2);
			}
			else if (pyjslib.bool(reverse)) {
				track.lineno=921;
				thisSort3 = function(a, b) {
					if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
					track={module:'pyjslib',lineno:921};trackstack.push(track);
					track.module='pyjslib';
					track.lineno=921;
					track.lineno=922;
					track.lineno=922;
					var pyjs__ret = -compareFunc(a, b);
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				};
				thisSort3.__name__ = 'thisSort3';

				thisSort3.parse_kwargs = function ( __kwargs, a, b ) {
					if (typeof a == 'undefined') {
						a=__kwargs.a;
						delete __kwargs.a;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort3', 'a');
					}
					if (typeof b == 'undefined') {
						b=__kwargs.b;
						delete __kwargs.b;
					} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.b != 'undefined') {
						pyjs__exception_func_multiple_values('thisSort3', 'b');
					}
					if (pyjs_options.arg_kwarg_unexpected_keyword) {
						for (var i in __kwargs) {
							pyjs__exception_func_unexpected_keyword('thisSort3', i);
						}
					}
					var __r = [a, b];
					for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
						__r.push(arguments[pyjs__va_arg]);
					}

					return __r;
				};
				track.lineno=923;
				self.l.sort(thisSort3);
			}
			else {
				track.lineno=925;
				self.l.sort(compareFunc);
			}
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return null;
		}
		, function ( __kwargs, compareFunc, keyFunc, reverse ) {
			if (typeof compareFunc == 'undefined') {
				compareFunc=__kwargs.compareFunc;
				delete __kwargs.compareFunc;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.compareFunc != 'undefined') {
				pyjs__exception_func_multiple_values('sort', 'compareFunc');
			}
			if (typeof keyFunc == 'undefined') {
				keyFunc=__kwargs.keyFunc;
				delete __kwargs.keyFunc;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.keyFunc != 'undefined') {
				pyjs__exception_func_multiple_values('sort', 'keyFunc');
			}
			if (typeof reverse == 'undefined') {
				reverse=__kwargs.reverse;
				delete __kwargs.reverse;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.reverse != 'undefined') {
				pyjs__exception_func_multiple_values('sort', 'reverse');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('sort', i);
				}
			}
			var __r = [compareFunc, keyFunc, reverse];
			for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.getArray = pyjs__bind_method(cls_instance, 'getArray', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return (self.l===undefined?(function(){throw new TypeError('self.l is undefined')})():(typeof self.l == 'function' && self.__is_instance__?pyjslib.getattr(self, 'l'):self.l));
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('getArray', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__repr__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__str__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.toString = pyjs__bind_method(cls_instance, 'toString', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__repr__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('toString', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== 'f9ccde39f155958204612cb792195f02') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var s = "(";
        for (var i=0; i < self.l.length; i++) {
            s += pyjslib.repr(self.l[i]);
            if (i < self.l.length - 1)
                s += ", ";
        };
        if (self.l.length == 1)
            s += ",";
        s += ")"
        return s;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__repr__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.object));
	})();
	track.lineno=962;
	pyjslib.tuple = pyjslib.Tuple;
	track.lineno=965;
	pyjslib.Dict = (function(){
		var cls_instance = pyjs__class_instance('Dict');
		var cls_definition = new Object();
		cls_definition.__md5__ = '992544cebd6c82ba4f4c477a27ae5805';
		cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function(data) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 0 || arguments.length > 1)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				data = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof data == 'undefined') data=null;

        this.d = {};

        if (pyjslib.isArray(data)) {
            for (var i in data) {
                var item=data[i];
                this.__setitem__(item[0], item[1]);
                //var sKey=pyjslib.hash(item[0]);
                //this.d[sKey]=item[1];
                }
            }
        else if (pyjslib.isIteratable(data)) {
            var iter=data.__iter__();
            try {
                while (true) {
                    var item=iter.next();
                    this.__setitem__(item.__getitem__(0), item.__getitem__(1));
                    }
                }
            catch (e) {
                if (e.__name__ != 'StopIteration') throw e;
                }
            }
        else if (pyjslib.isObject(data)) {
            for (var key in data) {
                this.__setitem__(key, data[key]);
                }
            }
        
		}
		, function ( __kwargs, data ) {
			if (typeof data == 'undefined') {
				data=__kwargs.data;
				delete __kwargs.data;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.data != 'undefined') {
				pyjs__exception_func_multiple_values('__init__', 'data');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__init__', i);
				}
			}
			var __r = [data];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__setitem__ = pyjs__bind_method(cls_instance, '__setitem__', function(key, value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				key = arguments[1];
				value = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var sKey = pyjslib.hash(key);
        this.d[sKey]=[key, value];
        
		}
		, function ( __kwargs, key, value ) {
			if (typeof key == 'undefined') {
				key=__kwargs.key;
				delete __kwargs.key;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.key != 'undefined') {
				pyjs__exception_func_multiple_values('__setitem__', 'key');
			}
			if (typeof value == 'undefined') {
				value=__kwargs.value;
				delete __kwargs.value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
				pyjs__exception_func_multiple_values('__setitem__', 'value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__setitem__', i);
				}
			}
			var __r = [key, value];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__getitem__ = pyjs__bind_method(cls_instance, '__getitem__', function(key) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				key = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var sKey = pyjslib.hash(key);
        var value=this.d[sKey];
        if (pyjslib.isUndefined(value)){
            throw pyjslib.KeyError(key);
        }
        return value[1];
        
		}
		, function ( __kwargs, key ) {
			if (typeof key == 'undefined') {
				key=__kwargs.key;
				delete __kwargs.key;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.key != 'undefined') {
				pyjs__exception_func_multiple_values('__getitem__', 'key');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__getitem__', i);
				}
			}
			var __r = [key];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__nonzero__ = pyjs__bind_method(cls_instance, '__nonzero__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        for (var i in this.d){
            return true;
        }
        return false;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__nonzero__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__len__ = pyjs__bind_method(cls_instance, '__len__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var size=0;
        for (var i in this.d) size++;
        return size;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__len__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.has_key = pyjs__bind_method(cls_instance, 'has_key', function(key) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				key = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__contains__(key);
		}
		, function ( __kwargs, key ) {
			if (typeof key == 'undefined') {
				key=__kwargs.key;
				delete __kwargs.key;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.key != 'undefined') {
				pyjs__exception_func_multiple_values('has_key', 'key');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('has_key', i);
				}
			}
			var __r = [key];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__delitem__ = pyjs__bind_method(cls_instance, '__delitem__', function(key) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				key = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var sKey = pyjslib.hash(key);
        delete this.d[sKey];
        
		}
		, function ( __kwargs, key ) {
			if (typeof key == 'undefined') {
				key=__kwargs.key;
				delete __kwargs.key;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.key != 'undefined') {
				pyjs__exception_func_multiple_values('__delitem__', 'key');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__delitem__', i);
				}
			}
			var __r = [key];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__contains__ = pyjs__bind_method(cls_instance, '__contains__', function(key) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				key = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var sKey = pyjslib.hash(key);
        return (pyjslib.isUndefined(this.d[sKey])) ? false : true;
        
		}
		, function ( __kwargs, key ) {
			if (typeof key == 'undefined') {
				key=__kwargs.key;
				delete __kwargs.key;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.key != 'undefined') {
				pyjs__exception_func_multiple_values('__contains__', 'key');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__contains__', i);
				}
			}
			var __r = [key];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.keys = pyjs__bind_method(cls_instance, 'keys', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var keys=new pyjslib.List();
        for (var key in this.d) {
            keys.append(this.d[key][0]);
        }
        return keys;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('keys', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.values = pyjs__bind_method(cls_instance, 'values', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var values=new pyjslib.List();
        for (var key in this.d) values.append(this.d[key][1]);
        return values;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('values', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.items = pyjs__bind_method(cls_instance, 'items', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var items = new pyjslib.List();
        for (var key in this.d) {
          var kv = this.d[key];
          items.append(new pyjslib.List(kv))
          }
          return items;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('items', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__iter__ = pyjs__bind_method(cls_instance, '__iter__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.keys().__iter__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__iter__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.iterkeys = pyjs__bind_method(cls_instance, 'iterkeys', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__iter__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('iterkeys', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.itervalues = pyjs__bind_method(cls_instance, 'itervalues', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.values().__iter__();
			return null;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('itervalues', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.iteritems = pyjs__bind_method(cls_instance, 'iteritems', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.items().__iter__();
			return null;
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('iteritems', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.setdefault = pyjs__bind_method(cls_instance, 'setdefault', function(key, default_value) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				key = arguments[1];
				default_value = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (pyjslib.bool(!(self.has_key(key)))) {
				self.__setitem__(key, default_value);
			}
			return self.__getitem__(key);
		}
		, function ( __kwargs, key, default_value ) {
			if (typeof key == 'undefined') {
				key=__kwargs.key;
				delete __kwargs.key;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.key != 'undefined') {
				pyjs__exception_func_multiple_values('setdefault', 'key');
			}
			if (typeof default_value == 'undefined') {
				default_value=__kwargs.default_value;
				delete __kwargs.default_value;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.default_value != 'undefined') {
				pyjs__exception_func_multiple_values('setdefault', 'default_value');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('setdefault', i);
				}
			}
			var __r = [key, default_value];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.get = pyjs__bind_method(cls_instance, 'get', function(key, default_) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length+1);
			} else {
				var self = arguments[0];
				key = arguments[1];
				default_ = arguments[2];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && (arguments.length < 2 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			if (typeof default_ == 'undefined') default_=null;
			if (pyjslib.bool(!(self.has_key(key)))) {
				return default_;
			}
			return self.__getitem__(key);
		}
		, function ( __kwargs, key, default_ ) {
			if (typeof key == 'undefined') {
				key=__kwargs.key;
				delete __kwargs.key;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.key != 'undefined') {
				pyjs__exception_func_multiple_values('get', 'key');
			}
			if (typeof default_ == 'undefined') {
				default_=__kwargs.default_;
				delete __kwargs.default_;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.default_ != 'undefined') {
				pyjs__exception_func_multiple_values('get', 'default_');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('get', i);
				}
			}
			var __r = [key, default_];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.update = pyjs__bind_method(cls_instance, 'update', function(d) {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length+1);
			} else {
				var self = arguments[0];
				d = arguments[1];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			var __temp_k = d.iteritems().__iter__();
			try {
				while (true) {
					var temp_k = __temp_k.next();
								var k = temp_k.__getitem__(0);
                			var v = temp_k.__getitem__(1);
                
					self.__setitem__(k, v);
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
			return null;
		}
		, function ( __kwargs, d ) {
			if (typeof d == 'undefined') {
				d=__kwargs.d;
				delete __kwargs.d;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.d != 'undefined') {
				pyjs__exception_func_multiple_values('update', 'd');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('update', i);
				}
			}
			var __r = [d];
			for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.getObject = pyjs__bind_method(cls_instance, 'getObject', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return (self.d===undefined?(function(){throw new TypeError('self.d is undefined')})():(typeof self.d == 'function' && self.__is_instance__?pyjslib.getattr(self, 'd'):self.d));
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('getObject', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.copy = pyjs__bind_method(cls_instance, 'copy', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return pyjslib.Dict(self.items());
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('copy', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__str__ = pyjs__bind_method(cls_instance, '__str__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__repr__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__str__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.toString = pyjs__bind_method(cls_instance, 'toString', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}
			return self.__repr__();
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('toString', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		cls_definition.__repr__ = pyjs__bind_method(cls_instance, '__repr__', function() {
			if (this.__is_instance__ === true) {
				var self = this;
				if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
			} else {
				var self = arguments[0];
				if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
				if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
			}
			if (pyjs_options.arg_instance_type) {
				if (self.prototype.__md5__ !== '992544cebd6c82ba4f4c477a27ae5805') {
					if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
						pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					}
				}
			}

        var keys = new Array();
        for (var key in self.d)
            keys.push(key);

        var s = "{";
        for (var i=0; i<keys.length; i++) {
            var v = self.d[keys[i]]
            s += pyjslib.repr(v[0]) + ": " + pyjslib.repr(v[1]);
            if (i < keys.length-1)
                s += ", "
        };
        s += "}";
        return s;
        
		}
		, function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('__repr__', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		});
		return pyjs__class_function(cls_instance, cls_definition, 
		                            new Array(pyjslib.object));
	})();
	track.lineno=1154;
	pyjslib.dict = pyjslib.Dict;
	track.lineno=1158;
	pyjslib._super = function(type_, object_or_type) {
		if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
		if (typeof object_or_type == 'undefined') object_or_type=null;
		if (pyjslib.bool(!(pyjslib._issubtype(object_or_type, type_)))) {
			throw (pyjslib.TypeError(String('super(type, obj): obj must be an instance or subtype of type')));
		}

    var fn = pyjs_type('super', type_.__mro__.slice(1), {})
    fn.__new__ = fn.__mro__[1].__new__;
    fn.__init__ = fn.__mro__[1].__init__;
    if (object_or_type.__is_instance__ === false) {
        return fn;
    }
    var obj = new Object();
    function wrapper(obj, name) {
        var fnwrap = function() {
            var args = [];
            for (var i = 0; i < arguments.length; i++) {
              args.push(arguments[i]);
            }
            return obj[name].apply(object_or_type,args);
        }
        fnwrap.__name__ = name;
        fnwrap.parse_kwargs = obj.parse_kwargs;
        return fnwrap;
    }
    for (var m in fn) {
        if (typeof fn[m] == 'function') {
            obj[m] = wrapper(fn, m);
        }
    }
    return obj;
    
	};
	pyjslib._super.__name__ = '_super';

	pyjslib._super.parse_kwargs = function ( __kwargs, type_, object_or_type ) {
		if (typeof type_ == 'undefined') {
			type_=__kwargs.type_;
			delete __kwargs.type_;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.type_ != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib._super', 'type_');
		}
		if (typeof object_or_type == 'undefined') {
			object_or_type=__kwargs.object_or_type;
			delete __kwargs.object_or_type;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.object_or_type != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib._super', 'object_or_type');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib._super', i);
			}
		}
		var __r = [type_, object_or_type];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1192;
	pyjslib.range = function(start, stop, step) {
		if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 1, 3, arguments.length);
		if (typeof stop == 'undefined') stop=null;
		if (typeof step == 'undefined') step=1;
		if (pyjslib.bool((stop === null))) {
			stop = start;
			start = 0;
		}

/*
    var start = 0;
    var stop = 0;
    var step = 1;

    if (arguments.length == 2) {
        start = arguments[0];
        stop = arguments[1];
        }
    else if (arguments.length == 3) {
        start = arguments[0];
        stop = arguments[1];
        step = arguments[2];
        }
    else if (arguments.length>0) stop = arguments[0];
*/
    return {
        'next': function() {
            if ((step > 0 && start >= stop) || (step < 0 && start <= stop)) throw pyjslib.StopIteration;
            var rval = start;
            start += step;
            return rval;
            },
        '__iter__': function() {
            return this;
            }
        }
    
	};
	pyjslib.range.__name__ = 'range';

	pyjslib.range.parse_kwargs = function ( __kwargs, start, stop, step ) {
		if (typeof start == 'undefined') {
			start=__kwargs.start;
			delete __kwargs.start;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.start != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.range', 'start');
		}
		if (typeof stop == 'undefined') {
			stop=__kwargs.stop;
			delete __kwargs.stop;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.stop != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.range', 'stop');
		}
		if (typeof step == 'undefined') {
			step=__kwargs.step;
			delete __kwargs.step;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.step != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.range', 'step');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.range', i);
			}
		}
		var __r = [start, stop, step];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1227;
	pyjslib.slice = function(object, lower, upper) {
		if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);

    if (pyjslib.isString(object)) {
        if (lower < 0) {
           lower = object.length + lower;
        }
        if (upper < 0) {
           upper = object.length + upper;
        }
        if (pyjslib.isNull(upper)) upper=object.length;
        return object.substring(lower, upper);
    }
    if (pyjslib.isObject(object) && object.slice)
        return object.slice(lower, upper);

    return null;
    
	};
	pyjslib.slice.__name__ = 'slice';

	pyjslib.slice.parse_kwargs = function ( __kwargs, object, lower, upper ) {
		if (typeof object == 'undefined') {
			object=__kwargs.object;
			delete __kwargs.object;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.object != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.slice', 'object');
		}
		if (typeof lower == 'undefined') {
			lower=__kwargs.lower;
			delete __kwargs.lower;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.lower != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.slice', 'lower');
		}
		if (typeof upper == 'undefined') {
			upper=__kwargs.upper;
			delete __kwargs.upper;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.upper != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.slice', 'upper');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.slice', i);
			}
		}
		var __r = [object, lower, upper];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1246;
	pyjslib.str = function(text) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    if (pyjslib.hasattr(text,"__str__")) {
        return text.__str__();
    }
    return String(text);
    
	};
	pyjslib.str.__name__ = 'str';

	pyjslib.str.parse_kwargs = function ( __kwargs, text ) {
		if (typeof text == 'undefined') {
			text=__kwargs.text;
			delete __kwargs.text;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.text != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.str', 'text');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.str', i);
			}
		}
		var __r = [text];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1255;
	pyjslib.ord = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		if (pyjslib.bool((pyjslib.isString(x)) && ((pyjslib.len(x) === 1)))) {

            return x.charCodeAt(0);
        
		}
		else {

            throw pyjslib.TypeError();
        
		}
		return null;
	};
	pyjslib.ord.__name__ = 'ord';

	pyjslib.ord.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.ord', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.ord', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1267;
	pyjslib.chr = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

        return String.fromCharCode(x)
    
	};
	pyjslib.chr.__name__ = 'chr';

	pyjslib.chr.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.chr', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.chr', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1273;
	pyjslib.is_basetype = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

       var t = typeof(x);
       return t == 'boolean' ||
       t == 'function' ||
       t == 'number' ||
       t == 'string' ||
       t == 'undefined'
       ;
    
	};
	pyjslib.is_basetype.__name__ = 'is_basetype';

	pyjslib.is_basetype.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.is_basetype', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.is_basetype', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1285;
	pyjslib.get_pyjs_classtype = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

        if (pyjslib.hasattr(x, "__is_instance__")) {
            var src = x.__name__;
            return src;
        }
        return null;
    
	};
	pyjslib.get_pyjs_classtype.__name__ = 'get_pyjs_classtype';

	pyjslib.get_pyjs_classtype.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.get_pyjs_classtype', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.get_pyjs_classtype', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1295;
	pyjslib.repr = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		if (pyjslib.bool(pyjslib.hasattr(x, String('__repr__')))) {
			return x.__repr__();
		}

       if (x === null)
           return "null";

       if (x === undefined)
           return "undefined";

       var t = typeof(x);

        //alert("repr typeof " + t + " : " + x);

       if (t == "boolean")
           return x.toString();

       if (t == "function")
           return "<function " + x.toString() + ">";

       if (t == "number")
           return x.toString();

       if (t == "string") {
           if (x.indexOf("'") == -1)
               return "'" + x + "'";
           if (x.indexOf('"') == -1)
               return '"' + x + '"';
           var s = x.replace(new RegExp('"', "g"), '\\"');
           return '"' + s + '"';
       };

       if (t == "undefined")
           return "undefined";

       // If we get here, x is an object.  See if it's a Pyjamas class.

       if (!pyjslib.hasattr(x, "__init__"))
           return "<" + x.toString() + ">";

       // Handle the common Pyjamas data types.

       var constructor = "UNKNOWN";

       constructor = pyjslib.get_pyjs_classtype(x);

        //alert("repr constructor: " + constructor);

       // If we get here, the class isn't one we know -> return the class name.
       // Note that we replace underscores with dots so that the name will
       // (hopefully!) look like the original Python name.

       //var s = constructor.replace(new RegExp('_', "g"), '.');
       return "<" + constructor + " object>";
    
	};
	pyjslib.repr.__name__ = 'repr';

	pyjslib.repr.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.repr', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.repr', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1354;
	pyjslib.float = function(text) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return parseFloat(text);
    
	};
	pyjslib.float.__name__ = 'float';

	pyjslib.float.parse_kwargs = function ( __kwargs, text ) {
		if (typeof text == 'undefined') {
			text=__kwargs.text;
			delete __kwargs.text;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.text != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.float', 'text');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.float', i);
			}
		}
		var __r = [text];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1360;
	pyjslib.int = function(text, radix) {
		if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
		if (typeof radix == 'undefined') radix=0;

    return parseInt(text, radix);
    
	};
	pyjslib.int.__name__ = 'int';

	pyjslib.int.parse_kwargs = function ( __kwargs, text, radix ) {
		if (typeof text == 'undefined') {
			text=__kwargs.text;
			delete __kwargs.text;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.text != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.int', 'text');
		}
		if (typeof radix == 'undefined') {
			radix=__kwargs.radix;
			delete __kwargs.radix;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.radix != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.int', 'radix');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.int', i);
			}
		}
		var __r = [text, radix];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1366;
	pyjslib.len = function(object) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    if (object==null) return 0;
    if (pyjslib.isObject(object) && object.__len__) return object.__len__();
    return object.length;
    
	};
	pyjslib.len.__name__ = 'len';

	pyjslib.len.parse_kwargs = function ( __kwargs, object ) {
		if (typeof object == 'undefined') {
			object=__kwargs.object;
			delete __kwargs.object;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.object != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.len', 'object');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.len', i);
			}
		}
		var __r = [object];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1374;
	pyjslib.isinstance = function(object_, classinfo) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
		if (pyjslib.bool(pyjslib.isUndefined(object_))) {
			return false;
		}
		if (pyjslib.bool(!(pyjslib.isObject(object_)))) {
			return false;
		}
		if (pyjslib.bool(pyjslib._isinstance(classinfo, pyjslib.Tuple))) {
			var __ci = classinfo.__iter__();
			try {
				while (true) {
					var ci = __ci.next();
					
					if (pyjslib.bool(pyjslib.isinstance(object_, ci))) {
						return true;
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
			return false;
		}
		else {
			return pyjslib._isinstance(object_, classinfo);
		}
		return null;
	};
	pyjslib.isinstance.__name__ = 'isinstance';

	pyjslib.isinstance.parse_kwargs = function ( __kwargs, object_, classinfo ) {
		if (typeof object_ == 'undefined') {
			object_=__kwargs.object_;
			delete __kwargs.object_;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.object_ != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isinstance', 'object_');
		}
		if (typeof classinfo == 'undefined') {
			classinfo=__kwargs.classinfo;
			delete __kwargs.classinfo;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.classinfo != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isinstance', 'classinfo');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isinstance', i);
			}
		}
		var __r = [object_, classinfo];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1389;
	pyjslib._isinstance = function(object_, classinfo) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);

    if (object_.__is_instance__ !== true) {
        return false;
    }
    for (var c in object_.__mro__) {
        if (object_.__mro__[c].__md5__ == classinfo.prototype.__md5__) return true;
    }
    return false;
    
	};
	pyjslib._isinstance.__name__ = '_isinstance';

	pyjslib._isinstance.parse_kwargs = function ( __kwargs, object_, classinfo ) {
		if (typeof object_ == 'undefined') {
			object_=__kwargs.object_;
			delete __kwargs.object_;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.object_ != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib._isinstance', 'object_');
		}
		if (typeof classinfo == 'undefined') {
			classinfo=__kwargs.classinfo;
			delete __kwargs.classinfo;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.classinfo != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib._isinstance', 'classinfo');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib._isinstance', i);
			}
		}
		var __r = [object_, classinfo];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1401;
	pyjslib._issubtype = function(object_, classinfo) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);

    if (object_.__is_instance__ == null || classinfo.__is_instance__ == null) {
        return false;
    }
    for (var c in object_.__mro__) {
        if (object_.__mro__[c] == classinfo.prototype) return true;
    }
    return false;
    
	};
	pyjslib._issubtype.__name__ = '_issubtype';

	pyjslib._issubtype.parse_kwargs = function ( __kwargs, object_, classinfo ) {
		if (typeof object_ == 'undefined') {
			object_=__kwargs.object_;
			delete __kwargs.object_;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.object_ != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib._issubtype', 'object_');
		}
		if (typeof classinfo == 'undefined') {
			classinfo=__kwargs.classinfo;
			delete __kwargs.classinfo;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.classinfo != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib._issubtype', 'classinfo');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib._issubtype', i);
			}
		}
		var __r = [object_, classinfo];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1413;
	pyjslib.getattr = function(obj, name, default_) {
		if (pyjs_options.arg_count && (arguments.length < 2 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length);
		if (typeof default_ == 'undefined') default_=null;

    if ((!pyjslib.isObject(obj))||(pyjslib.isUndefined(obj[name]))){
        if (arguments.length != 3){
            throw pyjslib.AttributeError(obj, name);
        }else{
        return default_;
        }
    }
    if (!pyjslib.isFunction(obj[name])) return obj[name];
    var method = obj[name];
    var fnwrap = function() {
        var args = [];
        for (var i = 0; i < arguments.length; i++) {
          args.push(arguments[i]);
        }
        return method.apply(obj,args);
    }
    fnwrap.__name__ = name;
    fnwrap.parse_kwargs = obj.parse_kwargs;
    return fnwrap;
    
	};
	pyjslib.getattr.__name__ = 'getattr';

	pyjslib.getattr.parse_kwargs = function ( __kwargs, obj, name, default_ ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.getattr', 'obj');
		}
		if (typeof name == 'undefined') {
			name=__kwargs.name;
			delete __kwargs.name;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.name != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.getattr', 'name');
		}
		if (typeof default_ == 'undefined') {
			default_=__kwargs.default_;
			delete __kwargs.default_;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.default_ != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.getattr', 'default_');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.getattr', i);
			}
		}
		var __r = [obj, name, default_];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1437;
	pyjslib.delattr = function(obj, name) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);

    if (!pyjslib.isObject(obj)) {
       throw pyjslib.AttributeError("'"+typeof(obj)+"' object has no attribute '"+name+"%s'")
    }
    if ((pyjslib.isUndefined(obj[name])) ||(typeof(obj[name]) == "function") ){
        throw pyjslib.AttributeError(obj.__name__+" instance has no attribute '"+ name+"'");
    }
    delete obj[name];
    
	};
	pyjslib.delattr.__name__ = 'delattr';

	pyjslib.delattr.parse_kwargs = function ( __kwargs, obj, name ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.delattr', 'obj');
		}
		if (typeof name == 'undefined') {
			name=__kwargs.name;
			delete __kwargs.name;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.name != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.delattr', 'name');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.delattr', i);
			}
		}
		var __r = [obj, name];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1449;
	pyjslib.setattr = function(obj, name, value) {
		if (pyjs_options.arg_count && arguments.length != 3) pyjs__exception_func_param(arguments.callee.__name__, 3, 3, arguments.length);

    if (!pyjslib.isObject(obj)) return null;

    obj[name] = value;

    
	};
	pyjslib.setattr.__name__ = 'setattr';

	pyjslib.setattr.parse_kwargs = function ( __kwargs, obj, name, value ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.setattr', 'obj');
		}
		if (typeof name == 'undefined') {
			name=__kwargs.name;
			delete __kwargs.name;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.name != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.setattr', 'name');
		}
		if (typeof value == 'undefined') {
			value=__kwargs.value;
			delete __kwargs.value;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.value != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.setattr', 'value');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.setattr', i);
			}
		}
		var __r = [obj, name, value];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1458;
	pyjslib.hasattr = function(obj, name) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);

    if (!pyjslib.isObject(obj)) return false;
    if (pyjslib.isUndefined(obj[name])) return false;

    return true;
    
	};
	pyjslib.hasattr.__name__ = 'hasattr';

	pyjslib.hasattr.parse_kwargs = function ( __kwargs, obj, name ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.hasattr', 'obj');
		}
		if (typeof name == 'undefined') {
			name=__kwargs.name;
			delete __kwargs.name;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.name != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.hasattr', 'name');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.hasattr', i);
			}
		}
		var __r = [obj, name];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1467;
	pyjslib.dir = function(obj) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    var properties=new pyjslib.List();
    for (property in obj) properties.append(property);
    return properties;
    
	};
	pyjslib.dir.__name__ = 'dir';

	pyjslib.dir.parse_kwargs = function ( __kwargs, obj ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.dir', 'obj');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.dir', i);
			}
		}
		var __r = [obj];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1475;
	pyjslib.filter = function(obj, method, sequence) {
		if (pyjs_options.arg_count && (arguments.length < 2 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length);
		if (typeof sequence == 'undefined') sequence=null;
		var items = new pyjslib.List([]);
		if (pyjslib.bool((sequence === null))) {
			sequence = method;
			method = obj;
			var __item = sequence.__iter__();
			try {
				while (true) {
					var item = __item.next();
					
					if (pyjslib.bool(method(item))) {
						items.append(item);
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else {
			var __item = sequence.__iter__();
			try {
				while (true) {
					var item = __item.next();
					
					if (pyjslib.bool(method.call_(obj, item))) {
						items.append(item);
					}
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		return items;
	};
	pyjslib.filter.__name__ = 'filter';

	pyjslib.filter.parse_kwargs = function ( __kwargs, obj, method, sequence ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.filter', 'obj');
		}
		if (typeof method == 'undefined') {
			method=__kwargs.method;
			delete __kwargs.method;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.method != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.filter', 'method');
		}
		if (typeof sequence == 'undefined') {
			sequence=__kwargs.sequence;
			delete __kwargs.sequence;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.sequence != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.filter', 'sequence');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.filter', i);
			}
		}
		var __r = [obj, method, sequence];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1495;
	pyjslib.map = function(obj, method, sequence) {
		if (pyjs_options.arg_count && (arguments.length < 2 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length);
		if (typeof sequence == 'undefined') sequence=null;
		var items = new pyjslib.List([]);
		if (pyjslib.bool((sequence === null))) {
			sequence = method;
			method = obj;
			var __item = sequence.__iter__();
			try {
				while (true) {
					var item = __item.next();
					
					items.append(method(item));
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		else {
			var __item = sequence.__iter__();
			try {
				while (true) {
					var item = __item.next();
					
					items.append(method.call_(obj, item));
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
		return items;
	};
	pyjslib.map.__name__ = 'map';

	pyjslib.map.parse_kwargs = function ( __kwargs, obj, method, sequence ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.map', 'obj');
		}
		if (typeof method == 'undefined') {
			method=__kwargs.method;
			delete __kwargs.method;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.method != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.map', 'method');
		}
		if (typeof sequence == 'undefined') {
			sequence=__kwargs.sequence;
			delete __kwargs.sequence;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.sequence != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.map', 'sequence');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.map', i);
			}
		}
		var __r = [obj, method, sequence];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1511;
	pyjslib.enumerate = function(sequence) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'pyjslib',lineno:1511};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1511;
		track.lineno=1512;
		var enumeration = new pyjslib.List([]);
		track.lineno=1513;
		var nextIndex = 0;
		track.lineno=1514;
		var pyjs__trackstack_size_1=trackstack.length;
		var __item = sequence.__iter__();
		try {
			while (true) {
				var item = __item.next();
				
				track.lineno=1515;
				enumeration.append(new pyjslib.List([nextIndex, item]));
				track.lineno=1516;
				nextIndex =  ( nextIndex + 1 ) ;
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (trackstack.length > pyjs__trackstack_size_1) {
			trackstack = trackstack.slice(0,pyjs__trackstack_size_1);
			track = trackstack.slice(-1)[0];
		}
		track.module='pyjslib';
		track.lineno=1517;
		track.lineno=1517;
		var pyjs__ret = enumeration;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.enumerate.__name__ = 'enumerate';

	pyjslib.enumerate.parse_kwargs = function ( __kwargs, sequence ) {
		if (typeof sequence == 'undefined') {
			sequence=__kwargs.sequence;
			delete __kwargs.sequence;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.sequence != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.enumerate', 'sequence');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.enumerate', i);
			}
		}
		var __r = [sequence];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1520;
	pyjslib.min = function() {
		if (pyjs_options.arg_count && arguments.length < 0) pyjs__exception_func_param(arguments.callee.__name__, 0, null, arguments.length);
		var sequence = pyjslib.Tuple();
		for (var pyjs__va_arg = 0; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
			var pyjs__arg = arguments[pyjs__va_arg];
			sequence.append(pyjs__arg);
		}
		track={module:'pyjslib',lineno:1520};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1520;
		track.lineno=1521;
		if (pyjslib.bool(pyjslib.eq(pyjslib.len(sequence), 1))) {
			track.lineno=1522;
			sequence = sequence.__getitem__(0);
		}
		track.lineno=1523;
		var minValue = null;
		track.lineno=1524;
		var pyjs__trackstack_size_1=trackstack.length;
		var __item = sequence.__iter__();
		try {
			while (true) {
				var item = __item.next();
				
				track.lineno=1525;
				if (pyjslib.bool((minValue === null))) {
					track.lineno=1526;
					minValue = item;
				}
				else if (pyjslib.bool(pyjslib.eq(pyjslib.cmp(item, minValue), -1))) {
					track.lineno=1528;
					minValue = item;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (trackstack.length > pyjs__trackstack_size_1) {
			trackstack = trackstack.slice(0,pyjs__trackstack_size_1);
			track = trackstack.slice(-1)[0];
		}
		track.module='pyjslib';
		track.lineno=1529;
		track.lineno=1529;
		var pyjs__ret = minValue;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.min.__name__ = 'min';

	pyjslib.min.parse_kwargs = function ( __kwargs ) {
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.min', i);
			}
		}
		var __r = [];
		for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1532;
	pyjslib.max = function() {
		if (pyjs_options.arg_count && arguments.length < 0) pyjs__exception_func_param(arguments.callee.__name__, 0, null, arguments.length);
		var sequence = pyjslib.Tuple();
		for (var pyjs__va_arg = 0; pyjs__va_arg < arguments.length; pyjs__va_arg++) {
			var pyjs__arg = arguments[pyjs__va_arg];
			sequence.append(pyjs__arg);
		}
		track={module:'pyjslib',lineno:1532};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1532;
		track.lineno=1533;
		if (pyjslib.bool(pyjslib.eq(pyjslib.len(sequence), 1))) {
			track.lineno=1534;
			sequence = sequence.__getitem__(0);
		}
		track.lineno=1535;
		var maxValue = null;
		track.lineno=1536;
		var pyjs__trackstack_size_1=trackstack.length;
		var __item = sequence.__iter__();
		try {
			while (true) {
				var item = __item.next();
				
				track.lineno=1537;
				if (pyjslib.bool((maxValue === null))) {
					track.lineno=1538;
					maxValue = item;
				}
				else if (pyjslib.bool(pyjslib.eq(pyjslib.cmp(item, maxValue), 1))) {
					track.lineno=1540;
					maxValue = item;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (trackstack.length > pyjs__trackstack_size_1) {
			trackstack = trackstack.slice(0,pyjs__trackstack_size_1);
			track = trackstack.slice(-1)[0];
		}
		track.module='pyjslib';
		track.lineno=1541;
		track.lineno=1541;
		var pyjs__ret = maxValue;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.max.__name__ = 'max';

	pyjslib.max.parse_kwargs = function ( __kwargs ) {
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.max', i);
			}
		}
		var __r = [];
		for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1544;
	pyjslib.next_hash_id = 0;
	track.lineno=1547;
	pyjslib.hash = function(obj) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    if (obj == null) return null;

    if (obj.$H) return obj.$H;
    if (obj.__hash__) return obj.__hash__();
    if (obj.constructor == String)
        return 'str'+obj;
    else if(obj.constructor == Number || obj.constructor == Date)
        return obj;

    obj.$H = ++pyjslib.next_hash_id;
    return obj.$H;
    
	};
	pyjslib.hash.__name__ = 'hash';

	pyjslib.hash.parse_kwargs = function ( __kwargs, obj ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.hash', 'obj');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.hash', i);
			}
		}
		var __r = [obj];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1562;
	pyjslib.hash = function(obj) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    if (obj == null) return null;

    if (obj.$H) return obj.$H;
    if (obj.__hash__) return obj.__hash__();
    if (obj.constructor == String || obj.constructor == Number || obj.constructor == Date) return obj;

    obj.$H = ++pyjslib.next_hash_id;
    return obj.$H;
    
	};
	pyjslib.hash.__name__ = 'hash';

	pyjslib.hash.parse_kwargs = function ( __kwargs, obj ) {
		if (typeof obj == 'undefined') {
			obj=__kwargs.obj;
			delete __kwargs.obj;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.obj != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.hash', 'obj');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.hash', i);
			}
		}
		var __r = [obj];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1576;
	pyjslib.isObject = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return (a != null && (typeof a == 'object')) || pyjslib.isFunction(a);
    
	};
	pyjslib.isObject.__name__ = 'isObject';

	pyjslib.isObject.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isObject', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isObject', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1582;
	pyjslib.isFunction = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return typeof a == 'function';
    
	};
	pyjslib.isFunction.__name__ = 'isFunction';

	pyjslib.isFunction.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isFunction', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isFunction', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1586;
	pyjslib.callable = pyjslib.isFunction;
	track.lineno=1589;
	pyjslib.isString = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return typeof a == 'string';
    
	};
	pyjslib.isString.__name__ = 'isString';

	pyjslib.isString.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isString', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isString', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1595;
	pyjslib.isNull = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return typeof a == 'object' && !a;
    
	};
	pyjslib.isNull.__name__ = 'isNull';

	pyjslib.isNull.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isNull', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isNull', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1601;
	pyjslib.isArray = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return pyjslib.isObject(a) && a.constructor == Array;
    
	};
	pyjslib.isArray.__name__ = 'isArray';

	pyjslib.isArray.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isArray', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isArray', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1607;
	pyjslib.isUndefined = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return typeof a == 'undefined';
    
	};
	pyjslib.isUndefined.__name__ = 'isUndefined';

	pyjslib.isUndefined.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isUndefined', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isUndefined', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1613;
	pyjslib.isIteratable = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return pyjslib.isString(a) || (pyjslib.isObject(a) && a.__iter__);
    
	};
	pyjslib.isIteratable.__name__ = 'isIteratable';

	pyjslib.isIteratable.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isIteratable', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isIteratable', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1619;
	pyjslib.isNumber = function(a) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);

    return typeof a == 'number' && isFinite(a);
    
	};
	pyjslib.isNumber.__name__ = 'isNumber';

	pyjslib.isNumber.parse_kwargs = function ( __kwargs, a ) {
		if (typeof a == 'undefined') {
			a=__kwargs.a;
			delete __kwargs.a;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.a != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.isNumber', 'a');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.isNumber', i);
			}
		}
		var __r = [a];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1625;
	pyjslib.toJSObjects = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		if (pyjslib.bool(pyjslib.isArray(x))) {

        var result = [];
        for(var k=0; k < x.length; k++) {
           var v = x[k];
           var tv = pyjslib.toJSObjects(v);
           result.push(tv);
        }
        return result;
        
		}
		if (pyjslib.bool(pyjslib.isObject(x))) {
			if (pyjslib.bool(pyjslib.isinstance(x, pyjslib.Dict))) {

            var o = x.getObject();
            var result = {};
            for (var i in o) {
               result[o[i][0].toString()] = o[i][1];
            }
            return pyjslib.toJSObjects(result)
            
			}
			else if (pyjslib.bool(pyjslib.isinstance(x, pyjslib.List))) {
				return pyjslib.toJSObjects((x.l===undefined?(function(){throw new TypeError('x.l is undefined')})():(typeof x.l == 'function' && x.__is_instance__?pyjslib.getattr(x, 'l'):x.l)));
			}
			else if (pyjslib.bool(pyjslib.hasattr(x, String('__class__')))) {
				return x;
			}
		}
		if (pyjslib.bool(pyjslib.isObject(x))) {

        var result = {};
        for(var k in x) {
            var v = x[k];
            var tv = pyjslib.toJSObjects(v)
            result[k] = tv;
            }
            return result;
         
		}
		return x;
	};
	pyjslib.toJSObjects.__name__ = 'toJSObjects';

	pyjslib.toJSObjects.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.toJSObjects', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.toJSObjects', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1669;
	pyjslib.sprintf = function(strng, args) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
		var constructor = pyjslib.get_pyjs_classtype(args);

    var re_dict = /([^%]*)%[(]([^)]+)[)]([#0  x2B-]*)(\d+)?(\.\d+)?[hlL]?(.)((.|\n)*)/;
    var re_list = /([^%]*)%([#0 +-]*)(\*|(\d+))?(\.\d+)?[hlL]?(.)((.|\n)*)/;
    var re_exp = /(.*)([+-])(.*)/;

		var strlen = pyjslib.len(strng);
		var argidx = 0;
		var nargs = 0;
		var result = new pyjslib.List([]);
		var remainder = strng;
		next_arg = function() {
			if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 0, 0, arguments.length);
			if (pyjslib.bool(pyjslib.eq(argidx, nargs))) {
				throw (pyjslib.TypeError(String('not enough arguments for format string')));
			}
			var arg = args.__getitem__(argidx);
			argidx += 1;
			return arg;
		};
		next_arg.__name__ = 'next_arg';

		next_arg.parse_kwargs = function ( __kwargs ) {
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('next_arg', i);
				}
			}
			var __r = [];
			for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		};
		formatarg = function(flags, minlen, precision, conversion, param) {
			if (pyjs_options.arg_count && arguments.length != 5) pyjs__exception_func_param(arguments.callee.__name__, 5, 5, arguments.length);
			var subst = String('');
			var numeric = true;
			if (pyjslib.bool(!(minlen))) {
				minlen = 0;
			}
			else {
				minlen = pyjslib.int(minlen);
			}
			if (pyjslib.bool(!(precision))) {
				precision = null;
			}
			else {
				precision = pyjslib.int(precision);
			}
			var left_padding = 1;
			if (pyjslib.bool((pyjslib.cmp(flags.find(String('-')), 0) != -1))) {
				left_padding = 0;
			}
			if (pyjslib.bool(pyjslib.eq(conversion, String('%')))) {
				numeric = false;
				subst = String('%');
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('c')))) {
				numeric = false;
				subst = pyjslib.chr(pyjslib.int(param));
			}
			else if (pyjslib.bool((pyjslib.eq(conversion, String('d'))) || (pyjslib.eq(conversion, String('i'))) || (pyjslib.eq(conversion, String('u'))))) {
				subst = pyjslib.str(pyjslib.int(param));
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('e')))) {
				if (pyjslib.bool((precision === null))) {
					precision = 6;
				}

                subst = re_exp.exec(String(param.toExponential(precision)));
                if (subst[3].length == 1) {
        	    subst = subst[1] + subst[2] + '0' + subst[3];
		} else {
        	    subst = subst[1] + subst[2] + subst[3];
		}
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('E')))) {
				if (pyjslib.bool((precision === null))) {
					precision = 6;
				}

                subst = re_exp.exec(String(param.toExponential(precision)).toUpperCase());
                if (subst[3].length == 1) {
        	    subst = subst[1] + subst[2] + '0' + subst[3];
		} else {
        	    subst = subst[1] + subst[2] + subst[3];
		}
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('f')))) {
				if (pyjslib.bool((precision === null))) {
					precision = 6;
				}

                subst = String(parseFloat(param).toFixed(precision));
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('F')))) {
				if (pyjslib.bool((precision === null))) {
					precision = 6;
				}

                subst = String(parseFloat(param).toFixed(precision)).toUpperCase();
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('g')))) {
				if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
					if (pyjslib.bool((precision === null))) {
						precision = 6;
					}
				}
				if (pyjslib.bool(((pyjslib.cmp(param, 1000000.0) != -1)) || ((pyjslib.cmp(param, 1e-05) == -1)))) {

                    subst = String(precision == null ? param.toExponential() : param.toExponential().toPrecision(precision));
				}
				else {

                    subst = String(precision == null ? parseFloat(param) : parseFloat(param).toPrecision(precision));
				}
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('G')))) {
				if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
					if (pyjslib.bool((precision === null))) {
						precision = 6;
					}
				}
				if (pyjslib.bool(((pyjslib.cmp(param, 1000000.0) != -1)) || ((pyjslib.cmp(param, 1e-05) == -1)))) {

                    subst = String(precision == null ? param.toExponential() : param.toExponential().toPrecision(precision)).toUpperCase();
				}
				else {

                    subst = String(precision == null ? parseFloat(param) : parseFloat(param).toPrecision(precision)).toUpperCase().toUpperCase();
				}
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('r')))) {
				numeric = false;
				subst = pyjslib.repr(param);
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('s')))) {
				numeric = false;
				subst = pyjslib.str(param);
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('o')))) {
				param = pyjslib.int(param);

                subst = param.toString(8);
				if (pyjslib.bool(((pyjslib.cmp(flags.find(String('#')), 0) != -1)) && ((subst != String('0'))))) {
					subst =  ( String('0') + subst ) ;
				}
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('x')))) {
				param = pyjslib.int(param);

                subst = param.toString(16);
				if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
					if (pyjslib.bool(left_padding)) {
						subst = subst.rjust( ( minlen - 2 ) , String('0'));
					}
					subst =  ( String('0x') + subst ) ;
				}
			}
			else if (pyjslib.bool(pyjslib.eq(conversion, String('X')))) {
				param = pyjslib.int(param);

                subst = param.toString(16).toUpperCase();
				if (pyjslib.bool((pyjslib.cmp(flags.find(String('#')), 0) != -1))) {
					if (pyjslib.bool(left_padding)) {
						subst = subst.rjust( ( minlen - 2 ) , String('0'));
					}
					subst =  ( String('0X') + subst ) ;
				}
			}
			else {
				throw (pyjslib.ValueError( (  (  (  (  ( String('unsupported format character \x27') + conversion )  + String('\x27 (') )  + pyjslib.hex(pyjslib.ord(conversion)) )  + String(') at index ') )  +  (  ( strlen - pyjslib.len(remainder) )  - 1 )  ) ));
			}
			if (pyjslib.bool((minlen) && ((pyjslib.cmp(pyjslib.len(subst), minlen) == -1)))) {
				var padchar = String(' ');
				if (pyjslib.bool((numeric) && (left_padding) && ((pyjslib.cmp(flags.find(String('0')), 0) != -1)))) {
					padchar = String('0');
				}
				if (pyjslib.bool(left_padding)) {
					subst = subst.rjust(minlen, padchar);
				}
				else {
					subst = subst.ljust(minlen, padchar);
				}
			}
			return subst;
		};
		formatarg.__name__ = 'formatarg';

		formatarg.parse_kwargs = function ( __kwargs, flags, minlen, precision, conversion, param ) {
			if (typeof flags == 'undefined') {
				flags=__kwargs.flags;
				delete __kwargs.flags;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.flags != 'undefined') {
				pyjs__exception_func_multiple_values('formatarg', 'flags');
			}
			if (typeof minlen == 'undefined') {
				minlen=__kwargs.minlen;
				delete __kwargs.minlen;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.minlen != 'undefined') {
				pyjs__exception_func_multiple_values('formatarg', 'minlen');
			}
			if (typeof precision == 'undefined') {
				precision=__kwargs.precision;
				delete __kwargs.precision;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.precision != 'undefined') {
				pyjs__exception_func_multiple_values('formatarg', 'precision');
			}
			if (typeof conversion == 'undefined') {
				conversion=__kwargs.conversion;
				delete __kwargs.conversion;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.conversion != 'undefined') {
				pyjs__exception_func_multiple_values('formatarg', 'conversion');
			}
			if (typeof param == 'undefined') {
				param=__kwargs.param;
				delete __kwargs.param;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.param != 'undefined') {
				pyjs__exception_func_multiple_values('formatarg', 'param');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('formatarg', i);
				}
			}
			var __r = [flags, minlen, precision, conversion, param];
			for (var pyjs__va_arg = 6;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		};
		sprintf_list = function(strng, args) {
			if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
    while (pyjslib.bool(remainder)) {

            var a = re_list.exec(remainder);
			if (pyjslib.bool((a === null))) {
				result.append(remainder);
				break;
			}

            var left = a[1], flags = a[2];
            var minlen = a[3], precision = a[5], conversion = a[6];
            remainder = a[7];
            if (typeof minlen == 'undefined') minlen = null;
            if (typeof precision == 'undefined') precision = null;
            if (typeof conversion == 'undefined') conversion = null;

			result.append(left);
			if (pyjslib.bool(pyjslib.eq(minlen, String('*')))) {
				var minlen = next_arg();
var minlen_type = typeof(minlen);
				if (pyjslib.bool(((minlen_type != String('number'))) || ((pyjslib.int(minlen) != minlen)))) {
					throw (pyjslib.TypeError(String('* wants int')));
				}
			}
			if (pyjslib.bool((conversion != String('%')))) {
				var param = next_arg();
			}
			result.append(formatarg(flags, minlen, precision, conversion, param));
    }
			return null;
		};
		sprintf_list.__name__ = 'sprintf_list';

		sprintf_list.parse_kwargs = function ( __kwargs, strng, args ) {
			if (typeof strng == 'undefined') {
				strng=__kwargs.strng;
				delete __kwargs.strng;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.strng != 'undefined') {
				pyjs__exception_func_multiple_values('sprintf_list', 'strng');
			}
			if (typeof args == 'undefined') {
				args=__kwargs.args;
				delete __kwargs.args;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.args != 'undefined') {
				pyjs__exception_func_multiple_values('sprintf_list', 'args');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('sprintf_list', i);
				}
			}
			var __r = [strng, args];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		};
		sprintf_dict = function(strng, args) {
			if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
			var arg = args;
			argidx += 1;
    while (pyjslib.bool(remainder)) {

            var a = re_dict.exec(remainder);
			if (pyjslib.bool((a === null))) {
				result.append(remainder);
				break;
			}

            var left = a[1], key = a[2], flags = a[3];
            var minlen = a[4], precision = a[5], conversion = a[6];
            remainder = a[7];
            if (typeof minlen == 'undefined') minlen = null;
            if (typeof precision == 'undefined') precision = null;
            if (typeof conversion == 'undefined') conversion = null;

			result.append(left);
			if (pyjslib.bool(!(arg.has_key(key)))) {
				throw (pyjslib.KeyError(key));
			}
			else {
				var param = arg.__getitem__(key);
			}
			result.append(formatarg(flags, minlen, precision, conversion, param));
    }
			return null;
		};
		sprintf_dict.__name__ = 'sprintf_dict';

		sprintf_dict.parse_kwargs = function ( __kwargs, strng, args ) {
			if (typeof strng == 'undefined') {
				strng=__kwargs.strng;
				delete __kwargs.strng;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.strng != 'undefined') {
				pyjs__exception_func_multiple_values('sprintf_dict', 'strng');
			}
			if (typeof args == 'undefined') {
				args=__kwargs.args;
				delete __kwargs.args;
			} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.args != 'undefined') {
				pyjs__exception_func_multiple_values('sprintf_dict', 'args');
			}
			if (pyjs_options.arg_kwarg_unexpected_keyword) {
				for (var i in __kwargs) {
					pyjs__exception_func_unexpected_keyword('sprintf_dict', i);
				}
			}
			var __r = [strng, args];
			for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
				__r.push(arguments[pyjs__va_arg]);
			}

			return __r;
		};

    var a = re_dict.exec(strng);

		if (pyjslib.bool((a === null))) {
			if (pyjslib.bool((constructor != String('Tuple')))) {
				args = new pyjslib.Tuple([args]);
			}
			nargs = pyjslib.len(args);
			sprintf_list(strng, args);
			if (pyjslib.bool((argidx != nargs))) {
				throw (pyjslib.TypeError(String('not all arguments converted during string formatting')));
			}
		}
		else {
			if (pyjslib.bool((constructor != String('Dict')))) {
				throw (pyjslib.TypeError(String('format requires a mapping')));
			}
			sprintf_dict(strng, args);
		}
		return String('').join(result);
	};
	pyjslib.sprintf.__name__ = 'sprintf';

	pyjslib.sprintf.parse_kwargs = function ( __kwargs, strng, args ) {
		if (typeof strng == 'undefined') {
			strng=__kwargs.strng;
			delete __kwargs.strng;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.strng != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.sprintf', 'strng');
		}
		if (typeof args == 'undefined') {
			args=__kwargs.args;
			delete __kwargs.args;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.args != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.sprintf', 'args');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.sprintf', i);
			}
		}
		var __r = [strng, args];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1869;
	pyjslib.printFunc = function(objs, newline) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);

    if ($wnd.console==undefined)  return;
    var s = "";
    for(var i=0; i < objs.length; i++) {
        if(s != "") s += " ";
        s += objs[i];
    }
    console.debug(s)
    
	};
	pyjslib.printFunc.__name__ = 'printFunc';

	pyjslib.printFunc.parse_kwargs = function ( __kwargs, objs, newline ) {
		if (typeof objs == 'undefined') {
			objs=__kwargs.objs;
			delete __kwargs.objs;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.objs != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.printFunc', 'objs');
		}
		if (typeof newline == 'undefined') {
			newline=__kwargs.newline;
			delete __kwargs.newline;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.newline != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.printFunc', 'newline');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.printFunc', i);
			}
		}
		var __r = [objs, newline];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1881;
	pyjslib.type = function(clsname, bases, methods) {
		if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 1, 3, arguments.length);
		if (typeof bases == 'undefined') bases=null;
		if (typeof methods == 'undefined') methods=null;
 var mths = {}; 
		if (pyjslib.bool(methods)) {
			var __k = methods.keys().__iter__();
			try {
				while (true) {
					var k = __k.next();
					
					var mth = methods.__getitem__(k);
 mths[k] = mth; 
				}
			} catch (e) {
				if (e.__name__ != 'StopIteration') {
					throw e;
				}
			}
		}
 var bss = null; 
		if (pyjslib.bool(bases)) {
bss = bases.l;
		}
 return pyjs_type(clsname, bss, mths); 
	};
	pyjslib.type.__name__ = 'type';

	pyjslib.type.parse_kwargs = function ( __kwargs, clsname, bases, methods ) {
		if (typeof clsname == 'undefined') {
			clsname=__kwargs.clsname;
			delete __kwargs.clsname;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.clsname != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.type', 'clsname');
		}
		if (typeof bases == 'undefined') {
			bases=__kwargs.bases;
			delete __kwargs.bases;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.bases != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.type', 'bases');
		}
		if (typeof methods == 'undefined') {
			methods=__kwargs.methods;
			delete __kwargs.methods;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.methods != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.type', 'methods');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.type', i);
			}
		}
		var __r = [clsname, bases, methods];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1896;
	pyjslib.pow = function(x, y, z) {
		if (pyjs_options.arg_count && (arguments.length < 2 || arguments.length > 3)) pyjs__exception_func_param(arguments.callee.__name__, 2, 3, arguments.length);
		if (typeof z == 'undefined') z=null;
		track={module:'pyjslib',lineno:1896};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1896;
		track.lineno=1897;
p = Math.pow(x, y);
		track.lineno=1898;
		if (pyjslib.bool((z === null))) {
			track.lineno=1899;
			track.lineno=1899;
			var pyjs__ret = pyjslib.float(p);
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		track.lineno=1900;
		track.lineno=1900;
		var pyjs__ret = pyjslib.float(p % z);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.pow.__name__ = 'pow';

	pyjslib.pow.parse_kwargs = function ( __kwargs, x, y, z ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.pow', 'x');
		}
		if (typeof y == 'undefined') {
			y=__kwargs.y;
			delete __kwargs.y;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.y != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.pow', 'y');
		}
		if (typeof z == 'undefined') {
			z=__kwargs.z;
			delete __kwargs.z;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.z != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.pow', 'z');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.pow', i);
			}
		}
		var __r = [x, y, z];
		for (var pyjs__va_arg = 4;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1902;
	pyjslib.hex = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'pyjslib',lineno:1902};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1902;
		track.lineno=1903;
		if (pyjslib.bool((pyjslib.int(x) != x))) {
			track.lineno=1904;
			throw (pyjslib.TypeError(String('hex() argument can\x27t be converted to hex')));
		}
		track.lineno=1905;
r = '0x'+x.toString(16);
		track.lineno=1906;
		track.lineno=1906;
		var pyjs__ret = pyjslib.str(r);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.hex.__name__ = 'hex';

	pyjslib.hex.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.hex', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.hex', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1908;
	pyjslib.oct = function(x) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'pyjslib',lineno:1908};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1908;
		track.lineno=1909;
		if (pyjslib.bool((pyjslib.int(x) != x))) {
			track.lineno=1910;
			throw (pyjslib.TypeError(String('oct() argument can\x27t be converted to oct')));
		}
		track.lineno=1911;
r = '0'+x.toString(8);
		track.lineno=1912;
		track.lineno=1912;
		var pyjs__ret = pyjslib.str(r);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.oct.__name__ = 'oct';

	pyjslib.oct.parse_kwargs = function ( __kwargs, x ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.oct', 'x');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.oct', i);
			}
		}
		var __r = [x];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1914;
	pyjslib.round = function(x, n) {
		if (pyjs_options.arg_count && (arguments.length < 1 || arguments.length > 2)) pyjs__exception_func_param(arguments.callee.__name__, 1, 2, arguments.length);
		if (typeof n == 'undefined') n=0;
		track={module:'pyjslib',lineno:1914};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1914;
		track.lineno=1915;
		n = pyjslib.pow(10, n);
		track.lineno=1916;
r = Math.round(n*x)/n;
		track.lineno=1917;
		track.lineno=1917;
		var pyjs__ret = pyjslib.float(r);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.round.__name__ = 'round';

	pyjslib.round.parse_kwargs = function ( __kwargs, x, n ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.round', 'x');
		}
		if (typeof n == 'undefined') {
			n=__kwargs.n;
			delete __kwargs.n;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.n != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.round', 'n');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.round', i);
			}
		}
		var __r = [x, n];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1919;
	pyjslib.divmod = function(x, y) {
		if (pyjs_options.arg_count && arguments.length != 2) pyjs__exception_func_param(arguments.callee.__name__, 2, 2, arguments.length);
		track={module:'pyjslib',lineno:1919};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1919;
		track.lineno=1920;
		if (pyjslib.bool((pyjslib.eq(pyjslib.int(x), x)) && (pyjslib.eq(pyjslib.int(y), y)))) {
			track.lineno=1921;
			track.lineno=1921;
			var pyjs__ret = new pyjslib.Tuple([pyjslib.int( ( x / y ) ), pyjslib.int(x % y)]);
			trackstack.pop();track=trackstack.pop();trackstack.push(track);
			return pyjs__ret;
		}
		track.lineno=1922;
f = Math.floor(x / y);
		track.lineno=1923;
		var f = pyjslib.float(f);
		track.lineno=1924;
		track.lineno=1924;
		var pyjs__ret = new pyjslib.Tuple([f,  ( x -  ( f * y )  ) ]);
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.divmod.__name__ = 'divmod';

	pyjslib.divmod.parse_kwargs = function ( __kwargs, x, y ) {
		if (typeof x == 'undefined') {
			x=__kwargs.x;
			delete __kwargs.x;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.x != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.divmod', 'x');
		}
		if (typeof y == 'undefined') {
			y=__kwargs.y;
			delete __kwargs.y;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.y != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.divmod', 'y');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.divmod', i);
			}
		}
		var __r = [x, y];
		for (var pyjs__va_arg = 3;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1926;
	pyjslib.all = function(iterable) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'pyjslib',lineno:1926};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1926;
		track.lineno=1927;
		var pyjs__trackstack_size_1=trackstack.length;
		var __element = iterable.__iter__();
		try {
			while (true) {
				var element = __element.next();
				
				track.lineno=1928;
				if (pyjslib.bool(!(element))) {
					track.lineno=1929;
					track.lineno=1929;
					var pyjs__ret = false;
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (trackstack.length > pyjs__trackstack_size_1) {
			trackstack = trackstack.slice(0,pyjs__trackstack_size_1);
			track = trackstack.slice(-1)[0];
		}
		track.module='pyjslib';
		track.lineno=1930;
		track.lineno=1930;
		var pyjs__ret = true;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.all.__name__ = 'all';

	pyjslib.all.parse_kwargs = function ( __kwargs, iterable ) {
		if (typeof iterable == 'undefined') {
			iterable=__kwargs.iterable;
			delete __kwargs.iterable;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.iterable != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.all', 'iterable');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.all', i);
			}
		}
		var __r = [iterable];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};
	track.lineno=1932;
	pyjslib.any = function(iterable) {
		if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
		track={module:'pyjslib',lineno:1932};trackstack.push(track);
		track.module='pyjslib';
		track.lineno=1932;
		track.lineno=1933;
		var pyjs__trackstack_size_1=trackstack.length;
		var __element = iterable.__iter__();
		try {
			while (true) {
				var element = __element.next();
				
				track.lineno=1934;
				if (pyjslib.bool(element)) {
					track.lineno=1935;
					track.lineno=1935;
					var pyjs__ret = true;
					trackstack.pop();track=trackstack.pop();trackstack.push(track);
					return pyjs__ret;
				}
			}
		} catch (e) {
			if (e.__name__ != 'StopIteration') {
				throw e;
			}
		}
		if (trackstack.length > pyjs__trackstack_size_1) {
			trackstack = trackstack.slice(0,pyjs__trackstack_size_1);
			track = trackstack.slice(-1)[0];
		}
		track.module='pyjslib';
		track.lineno=1936;
		track.lineno=1936;
		var pyjs__ret = false;
		trackstack.pop();track=trackstack.pop();trackstack.push(track);
		return pyjs__ret;
	};
	pyjslib.any.__name__ = 'any';

	pyjslib.any.parse_kwargs = function ( __kwargs, iterable ) {
		if (typeof iterable == 'undefined') {
			iterable=__kwargs.iterable;
			delete __kwargs.iterable;
		} else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.iterable != 'undefined') {
			pyjs__exception_func_multiple_values('pyjslib.any', 'iterable');
		}
		if (pyjs_options.arg_kwarg_unexpected_keyword) {
			for (var i in __kwargs) {
				pyjs__exception_func_unexpected_keyword('pyjslib.any', i);
			}
		}
		var __r = [iterable];
		for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
			__r.push(arguments[pyjs__va_arg]);
		}

		return __r;
	};

return this;
}; /* end pyjslib */ 


/* initialize static library */
pyjslib();


//
// END LIB pyjslib
//


//
// BEGIN JS _pyjs.js
//


function pyjs_args_merge(func, star_args, dstar_args, args)
{
    var call_args;

    if (star_args) {
        if (!pyjslib.isIteratable(star_args)) {
            throw (pyjslib.TypeError(func.__name__ + "() arguments after * must be a sequence" + pyjslib.repr(star_args)));
        }
        if (star_args.l != null && star_args.l.constructor == Array) {
            call_args = args.concat(star_args.l);
        } else {
            call_args = Array();
            var __i = star_args.__iter__();
            var i = 0;
            try {
                while (true) {
                    call_args[i]=__i.next();
                    i++;
                }
            } catch (e) {
                if (e != pyjslib.StopIteration) {
                    throw e;
                }
            }
            call_args = args.concat(call_args);
        }
    }
    else
    {
        call_args = args;
    }
    if (dstar_args) {
        if (pyjslib.get_pyjs_classtype(dstar_args) != 'Dict') {
            throw (pyjslib.TypeError(func.__name__ + "() arguments after ** must be a dictionary " + pyjslib.repr(dstar_args)));
        }
        var __i = dstar_args.__iter__();
        try {
            while (true) {
                var i = __i.next();
                if (pyjs_options.arg_kwarg_multiple_values && typeof call_args[0][i] != 'undefined') {
                    pyjs__exception_func_multiple_values(func.__name__, i);
                }
                call_args[0][i] = dstar_args.__getitem__(i)
            }
        } catch (e) {
            if (e != pyjslib.StopIteration) {
                throw e;
            }
        }

    }
    return call_args;
}

function pyjs_kwargs_function_call(func, star_args, dstar_args, args)
{
    args = pyjs_args_merge(func, star_args, dstar_args, args);
    if (func.parse_kwargs) {
        args = func.parse_kwargs.apply(null, args);
    } else if (pyjs_options.arg_kwarg_unexpected_keyword && args.length > 0) {
        for (var i in args[0]) {
            pyjs__exception_func_unexpected_keyword(func.__name__, i);
        }
    }
    return func.apply(null, args);
}

function pyjs_kwargs_method_call(obj, method_name, star_args, dstar_args, args)
{
    var method = obj[method_name];
    args = pyjs_args_merge(method, star_args, dstar_args, args);
    if (method.parse_kwargs)
    {
        args = method.parse_kwargs.apply(null, args);
    } else if (pyjs_options.arg_kwarg_unexpected_keyword && args.length > 0) {
        for (var i in args[0]) {
            pyjs__exception_func_unexpected_keyword(method.__name__, i);
        }
    }
    return method.apply(obj, args);
}

function pyjs__exception_func_param(func_name, minargs, maxargs, nargs) {
    if (minargs == maxargs) {
        switch (minargs) {
            case 0:
                var msg = func_name + "() takes no arguments (" + nargs + " given)";
                break;
            case 1:
                msg = func_name + "() takes exactly " + minargs + " argument (" + nargs + " given)";
                break;
            default:
                msg = func_name + "() takes exactly " + minargs + " arguments (" + nargs + " given)";
        };
    } else if (nargs > maxargs) {
        if (maxargs == 1) {
            msg  = func_name + "() takes at most " + maxargs + " argument (" + nargs + " given)";
        } else {
            msg = func_name + "() takes at most " + maxargs + " arguments (" + nargs + " given)";
        }
    } else if (nargs < minargs) {
        if (minargs == 1) {
            msg = func_name + "() takes at least " + minargs + " argument (" + nargs + " given)";
        } else {
            msg = func_name + "() takes at least " + minargs + " arguments (" + nargs + " given)";
        }
    } else {
        return;
    }
    //throw msg
    throw pyjslib.TypeError(String(msg));
}

function pyjs__exception_func_multiple_values(func_name, key) {
    //throw func_name + "() got multiple values for keyword argument '" + key + "'";
    throw pyjslib.TypeError(String(func_name + "() got multiple values for keyword argument '" + key + "'"));
}

function pyjs__exception_func_unexpected_keyword(func_name, key) {
    //throw func_name + "() got an unexpected keyword argument '" + key + "'";
    throw pyjslib.TypeError(String(func_name + "() got an unexpected keyword argument '" + key + "'"));
}

function pyjs__exception_func_class_expected(func_name, class_name, instance) {
        if (typeof instance == 'undefined') {
            instance = 'nothing';
        } else if (instance.__is_instance__ == null) {
            instance = "'"+String(instance)+"'";
        } else {
            instance = String(instance);
        }
        //throw "unbound method "+func_name+"() must be called with "+class_name+" class as first argument (got "+instance+" instead)";
        throw pyjslib.TypeError(String("unbound method "+func_name+"() must be called with "+class_name+" class as first argument (got "+instance+" instead)"));
}

function pyjs__exception_func_instance_expected(func_name, class_name, instance) {
        if (typeof instance == 'undefined') {
            instance = 'nothing';
        } else if (instance.__is_instance__ == null) {
            instance = "'"+String(instance)+"'";
        } else {
            instance = String(instance);
        }
        //throw "unbound method "+func_name+"() must be called with "+class_name+" instance as first argument (got "+instance+" instead)";
        throw pyjslib.TypeError(String("unbound method "+func_name+"() must be called with "+class_name+" instance as first argument (got "+instance+" instead)"));
}

function pyjs__bind_method(klass, func_name, func, parse_kwargs) {
    func.__name__ = func.func_name = func_name;
    func.__class__ = klass;
    func.prototype = func;
    if (typeof parse_kwargs != 'undefined') func.parse_kwargs = parse_kwargs;
    return func;
}
function pyjs__instancemethod(klass, func_name, func, parse_kwargs) {
    var fn = function () {
        var _this = this;
        var argstart = 0;
        if (this.__is_instance__ !== true && arguments.length > 0) {
            _this = arguments[0];
            argstart = 1;
        }
        var args = new Array(_this);
        for (var a=argstart;a < arguments.length; a++) args.push(arguments[a]);
        if (pyjs_options.arg_is_instance) {
            if (_this.__is_instance__ === true) {
                if (pyjs_options.arg_instance_type) return func.apply(this, args);
                for (var c in _this.__mro__) {
                    var cls = _this.__mro__[c];
                    if (cls == klass) {
                        return func.apply(this, args);
                    }
                }
            }
            pyjs__exception_func_instance_expected(func_name, klass.__name__, _this);
        }
        return func.apply(this, args);
    };
    func.__name__ = func.func_name = func_name;
    func.__class__ = klass;
    if (typeof parse_kwargs != 'undefined') func.parse_kwargs = parse_kwargs;
    return fn;
}

function pyjs__staticmethod(klass, func_name, func, parse_kwargs) {
    func.__name__ = func.func_name = func_name;
    func.__class__ = klass;
    if (typeof parse_kwargs != 'undefined') func.parse_kwargs = parse_kwargs;
    return func;
}

function pyjs__classmethod(klass, func_name, func, parse_kwargs) {
    var fn = function () {
        if (pyjs_options.arg_is_instance && this.__is_instance__ !== true && this.__is_instance__ !== false) pyjs__exception_func_instance_expected(func_name, klass.__name__);
        var args = new Array(this.prototype);
        for (var a=0;a < arguments.length; a++) args.push(arguments[a]);
        return func.apply(this, args);
    };
    func.__name__ = func.func_name = func_name;
    func.__class__ = klass;
    if (typeof parse_kwargs != 'undefined') func.parse_kwargs = parse_kwargs;
    return fn;
}

function pyjs__subclasses__(cls_obj) {
    return cls_obj.__sub_classes__;
}

function pyjs__mro_merge(seqs) {
    var res = new Array();
    var i = 0;
    var cand = null;
    function resolve_error(candidates) {
        //throw "Cannot create a consistent method resolution order (MRO) for bases " + candidates[0].__name__ + ", "+ candidates[1].__name__;
        throw (pyjslib.TypeError("Cannot create a consistent method resolution order (MRO) for bases " + candidates[0].__name__ + ", "+ candidates[1].__name__));
    }
    for (;;) {
        var nonemptyseqs = new Array();
        for (var j = 0; j < seqs.length; j++) {
            if (seqs[j].length > 0) nonemptyseqs.push(seqs[j]);
        }
        if (nonemptyseqs.length == 0) return res;
        i++;
        var candidates = new Array();
        for (var j = 0; j < nonemptyseqs.length; j++) {
            cand = nonemptyseqs[j][0];
            candidates.push(cand);
            var nothead = new Array();
            for (var k = 0; k < nonemptyseqs.length; k++) {
                for (var m = 1; m < nonemptyseqs[k].length; m++) {
                    if (cand == nonemptyseqs[k][m]) {
                        nothead.push(nonemptyseqs[k]);
                    }
                }
            }
            if (nothead.length != 0)
                cand = null; // reject candidate
            else
                break;
        }
        if (cand == null) {
            resolve_error(candidates);
        }
        res.push(cand);
        for (var j = 0; j < nonemptyseqs.length; j++) {
            if (nonemptyseqs[j][0] == cand) {
                nonemptyseqs[j].shift();
            }
        }
    }
}

function pyjs__class_instance(class_name, module_name) {
    if (typeof module_name == 'undefined') module_name = typeof __mod_name__ == 'undefined' ? '__main__' : __mod_name__;
    var cls_fn = function(){
        var instance = cls_fn.__new__.apply(null, [cls_fn]);
        if (instance.__init__) {
            if (instance.__init__.apply(instance, arguments) != null) {
                //throw '__init__() should return None';
                throw pyjslib.TypeError('__init__() should return None');
            }
        }
        return instance;
    }
    cls_fn.__name__ = class_name;
    cls_fn.__module__ = module_name;
    cls_fn.toString = function() { return (this.__is_instance__ === true ? "instance of " : "class ") + (this.__module__?this.__module__ + "." : "") + this.__name__;}
    return cls_fn;
}

function pyjs__class_function(cls_fn, prop, bases) {
    if (typeof cls_fn != 'function') throw "compiler error? pyjs__class_function: typeof cls_fn != 'function'";
    var class_name = cls_fn.__name__;
    var class_module = cls_fn.__module__;
    var base_mro_list = new Array()
    for (var i = 0; i < bases.length; i++) {
        if (bases[i].__mro__ != null) {
            base_mro_list.push(new Array().concat(bases[i].__mro__));
        }
    }
    var __mro__ = pyjs__mro_merge(base_mro_list);

    for (var b = __mro__.length-1; b >= 0; b--) {
        var base = __mro__[b];
        for (var p in base) cls_fn[p] = base[p];
    }
    for (var p in prop) cls_fn[p] = prop[p];

    if (prop.__new__ == null) {
        cls_fn.__new__ = pyjs__bind_method(cls_fn, '__new__', function(cls) {
    var instance = function () {};
    instance.prototype = arguments[0].prototype;
    instance = new instance();
    instance.__dict__ = instance.__class__ = instance;
    instance.__is_instance__ = true;
    return instance;
}, function (__kwargs, cls) {
    if (typeof cls == 'undefined') {
        cls=__kwargs.cls;
        delete __kwargs.cls;
    } else if (pyjs_options.arg_kwarg_multiple_values && typeof __kwargs.cls != 'undefined') {
        pyjs__exception_func_multiple_values('__new__', 'cls');
    }
    if (pyjs_options.arg_kwarg_unexpected_keyword) {
        for (var i in __kwargs) {
            pyjs__exception_func_unexpected_keyword('__new__', i);
        }
    }
    var __r = [cls];
    for (var pyjs__va_arg = 2;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
        __r.push(arguments[pyjs__va_arg]);
    }

    return __r;
});

    }
    if (cls_fn['__init__'] == null) {
        cls_fn['__init__'] = pyjs__bind_method(cls_fn, '__init__', function () {
    if (this.__is_instance__ === true) {
        var self = this;
        if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
    } else {
        var self = arguments[0];
        if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
        if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
    }
    if (pyjs_options.arg_instance_type) {
        if (arguments.callee !== arguments.callee.__class__[arguments.callee.__name__]) {
            if (!pyjslib._isinstance(self, arguments.callee.__class__.slice(1))) {
                pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
            }
        }
    }
}, function (__kwargs) {
    var __r = [];
    return __r;
});
    }
    cls_fn.__name__ = class_name;
    cls_fn.__module__ = class_module;
    //cls_fn.__mro__ = pyjslib.List(new Array(cls_fn).concat(__mro__));
    cls_fn.__mro__ = new Array(cls_fn).concat(__mro__);
    cls_fn.prototype = cls_fn;
    cls_fn.__dict__ = cls_fn;
    cls_fn.__is_instance__ = false;
    cls_fn.__super_classes__ = bases;
    cls_fn.__sub_classes__ = new Array();
    for (var i = 0; i < bases.length; i++) {
        (bases[i]).__sub_classes__.push(cls_fn);
    }
    cls_fn.parse_kwargs = function () {
        return cls_fn.__init__.parse_kwargs.apply(null, arguments);
    }
    return cls_fn;
}

/* creates a class, derived from bases, with methods and variables */
function pyjs_type(clsname, bases, methods)
{
    var cls_instance = pyjs__class_instance(clsname);
    var obj = new Object;
    for (var i in methods) {
        if (typeof methods[i] == 'function') {
            obj[i] = pyjs__instancemethod(cls_instance, i, methods[i], methods[i].parse_kwargs);
        } else {
            obj[i] = methods[i];
        }
    }
    return pyjs__class_function(cls_instance, obj, bases);
}

String.prototype.__getitem__ = String.prototype.charAt;
String.prototype.upper = String.prototype.toUpperCase;
String.prototype.lower = String.prototype.toLowerCase;
String.prototype.find=pyjslib.String_find;
String.prototype.join=pyjslib.String_join;
String.prototype.isdigit=pyjslib.String_isdigit;
String.prototype.__iter__=pyjslib.String___iter__;

String.prototype.__replace=String.prototype.replace;
String.prototype.replace=pyjslib.String_replace;

String.prototype.split=pyjslib.String_split;
String.prototype.strip=pyjslib.String_strip;
String.prototype.lstrip=pyjslib.String_lstrip;
String.prototype.rstrip=pyjslib.String_rstrip;
String.prototype.startswith=pyjslib.String_startswith;
String.prototype.endswith=pyjslib.String_endswith;
String.prototype.ljust=pyjslib.String_ljust;
String.prototype.rjust=pyjslib.String_rjust;
String.prototype.center=pyjslib.String_center;

var str = String;



//
// END JS _pyjs.js
//


//
// BEGIN JS dynamicajax.js
//


function pyjs_createHttpRequest(){

	if(window.ActiveXObject){
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				return null;
	 		}
	 	}
	} else if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	} else {
		return null;
	}
}

/**
 * activate_css(str)
 *
 * looks for any < link > in the input and sets up a corresponding link node
 * in the main document.
 *
 */

function pyjs_activate_css(targetnode)
{
	var scriptnodes = targetnode.getElementsByTagName('link')
	var LC;
	for (LC = 0; LC < scriptnodes.length; LC++)
	{
		var sn = scriptnodes[LC];
		sn.parentNode.removeChild(sn);

		fileref = document.createElement('link')

		if (sn.href)
		{
			fileref.href = sn.href;
		}
		else
		{
			fileref.text = sn.text;
		}

		fileref.rel = "stylesheet";
		fileref.type = "text/css";

		document.getElementsByTagName("head").item(0).appendChild(fileref);
	}
}

/**
 * activate_javascript(str)
 *
 * looks for any < script > in the input text and sets up a corresponding
 * script node in the main document.
 *
 */

function pyjs_activate_javascript(txt)
{
    var fileref = document.createElement('script')

    /*alert(txt);*/

    fileref.text = txt;
    fileref.type = "text/javascript";
    fileref.language = "javascript";
    /*
    fileref.defer = true;
    */

    /*alert(fileref.text);*/

    /*
    var debug = document.createElement('pre');
    debug.innerHTML = 'test';
    debug.innerHTML += "href:" + sn.src + " text:" + fileref.text;
    var bodyels = document.getElementsByTagName("body");
    bodyels[bodyels.length-1].appendChild(debug);
    */

    fileref = fileref.cloneNode(true);


    document.getElementsByTagName("head").item(0).appendChild(fileref);
}

function pyjs_eval(str)
{
    if (window.execScript) {
        window.execScript(str);
    } else {
        eval(str);
    }
}

/**
 * ajax_eval(url)
 *
 * @param url	load and activate url
 * @returns		readyState
 */

function pyjs_ajax_eval(url, on_load_fn, async)
{
    window.status = ('Loading ' + url);
    alert('Loading ' + url + async);

	var xhtoj = pyjs_createHttpRequest()
	var res = xhtoj.open("GET", url , async );

	xhtoj.onreadystatechange = function() 
	{
		if ((xhtoj.readyState==4) && (xhtoj.status == 200) )
		{
			str = xhtoj.responseText;

            pyjs_activate_javascript(str);

            window.status = ('Loaded ' + url);

            if (on_load_fn)
                pyjs_eval(on_load_fn);
		}
	}

	xhtoj.send("")
}

/**
 * pyjs_load_script
 *
 * @param url      load script url
 * @param module   module name
 * @param onload   text of function to be eval/executed on successful load
 */

function pyjs_load_script(url, onload, async)
{
    window.status = ('Loading ' + url);

    var e = document.createElement("script");
    e.src = url;
    e.type="text/javascript";
    e.language = "javascript";
    e.defer = async;
    e.onload = function()
    {
        window.status = ('Loaded ' + url);
        if (onload)
            pyjs_eval(onload);
        return true;
    };
    document.getElementsByTagName("head")[0].appendChild(e);
}

/**
 * ajax_dlink_refresh(oj,url)
 *
 * @param id	id of element for insert
 * @param url	load url
 * @param timeout	refresh timeout period, ms
 * @returns		readyState
 */

/* use these to overrun an existing timeout, so that
   we don't end up with several of them!
 */
var running_timeout = 0;
var timeout_idname;
var timeout_url;
var timeout_on_load_fn;
var redo_timeout;
var timeout_id = null;

function pyjs_ajax_dlink_refresh(idname, url, on_load_fn, timeout)
{
	timeout_idname = idname;
	timeout_url = url;
	timeout_on_load_fn = on_load_fn;
	redo_timeout = timeout;
	if (running_timeout)
		return;
	timeout_id = setTimeout("pyjs_do_ajax_dlink_refresh()", timeout);
	running_timeout = 1;
}

function pyjs_do_ajax_dlink_refresh()
{
	if (pyjs_ajax_dlink(timeout_idname, timeout_url, timeout_on_load_fn) == 0)
	{
        timeout_id = null;
		running_timeout = 0;
		return;
	}
    timeout_id = null;
	running_timeout = 0;
	ajax_dlink_refresh(timeout_idname, timeout_url, timeout_on_load_fn,
                       redo_timeout);
}

/**
 * ajax_dlink(oj,url)
 *
 * @param id	id of element for insert
 * @param url	load url
 * @returns		readyState
 */

function pyjs_ajax_dlink(idname, url, on_load_fn)
{
	var body = document.body;

    if (timeout_id)
        clearTimeout(timeout_id); /* really important - get into a mess otherwise */
	var xhtoj = pyjs_createHttpRequest();

	xhtoj.onreadystatechange = function() 
	{
		if (xhtoj.readyState==4)
		{
			var jsnode = 0;
			if (xhtoj.status == 200)
			{
				txt = xhtoj.responseText;

				jsnode = null;

                if (idname)
                    jsnode = document.getElementById(idname);

				if (!jsnode)
				{
                    jsnode = document.createElement('script')
                }

                /*
                var tst = document.createElement('html')
                tst.innerHTML = str;
                */
                pyjs_activate_javascript(txt);
                if (on_load_fn)
                {
                    alert(on_load_fn);
                    /*if (window.execScript) {
                        window.execScript(on_load_fn);
                    } else {
                        eval(on_load_fn);
                    }
                    */
                    test_fn();
                }

                return 1;
			}
			else
			{
				jsnode = document.getElementById(idname);

				if (jsnode)
				{
					jsnode.innerHTML = xhtoj.status;
				}
			}
		}
	}

	xhtoj.open("GET", url , true );
	xhtoj.send("");

	return 0;
}




//
// END JS dynamicajax.js
//




/*
 * prepare app system vars
 */
sys.overrides = new pyjslib.Dict({
		
	});
sys.platform = 'ie6';
sys.appname = 'TestApp';
sys.loadpath = './';

/* app libs */
// TestApp

// module libs (usually imported javascript)



// module code

var TestApp = function (__mod_name__) {
	if(TestApp.__was_initialized__) return;
	TestApp.__was_initialized__ = true;
	if (__mod_name__ == null) __mod_name__ = 'TestApp';
	var __name__ = TestApp.__name__ = __mod_name__;
	TestApp.__track_lines__ = new Array();
		TestApp.__track_lines__[1] = "TestApp.py, line 1:\n    class Temp(object):";
		TestApp.__track_lines__[2] = "TestApp.py, line 2:\n    def __init__(self):";
		TestApp.__track_lines__[3] = "TestApp.py, line 3:\n    self.s = True";
		TestApp.__track_lines__[4] = "TestApp.py, line 4:\n    if __name__ == \'__main__\':";
		TestApp.__track_lines__[5] = "TestApp.py, line 5:\n    t = Temp()";
		TestApp.__track_lines__[6] = "TestApp.py, line 6:\n    if t.s:";
		TestApp.__track_lines__[7] = "TestApp.py, line 7:\n    print \'xxx\'";
	try {
		track.module='TestApp';
		track.lineno=1;
		track.lineno=1;
		TestApp.Temp = (function(){
			var cls_instance = pyjs__class_instance('Temp');
			var cls_definition = new Object();
			cls_definition.__md5__ = 'da5498611bf229d9ab7681d2ca5bc122';
			cls_definition.__init__ = pyjs__bind_method(cls_instance, '__init__', function() {
				if (this.__is_instance__ === true) {
					var self = this;
					if (pyjs_options.arg_count && arguments.length != 0) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length+1);
				} else {
					var self = arguments[0];
					if (pyjs_options.arg_is_instance && self.__is_instance__ !== true) pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
					if (pyjs_options.arg_count && arguments.length != 1) pyjs__exception_func_param(arguments.callee.__name__, 1, 1, arguments.length);
				}
				if (pyjs_options.arg_instance_type) {
					if (self.prototype.__md5__ !== 'da5498611bf229d9ab7681d2ca5bc122') {
						if (!pyjslib._isinstance(self, arguments.callee.__class__)) {
							pyjs__exception_func_instance_expected(arguments.callee.__name__, arguments.callee.__class__.__name__, self);
						}
					}
				}
				track={module:TestApp, lineno:2};trackstack.push(track);
				track.module='TestApp';
				track.lineno=2;
				track.lineno=3;
				self.s = true;
				trackstack.pop();track=trackstack.pop();trackstack.push(track);
				return null;
			}
			, function ( __kwargs ) {
				if (pyjs_options.arg_kwarg_unexpected_keyword) {
					for (var i in __kwargs) {
						pyjs__exception_func_unexpected_keyword('__init__', i);
					}
				}
				var __r = [];
				for (var pyjs__va_arg = 1;pyjs__va_arg < arguments.length;pyjs__va_arg++) {
					__r.push(arguments[pyjs__va_arg]);
				}

				return __r;
			});
			return pyjs__class_function(cls_instance, cls_definition, 
			                            new Array(pyjslib.object));
		})();
		track.lineno=4;
		if (pyjslib.bool(pyjslib.eq(TestApp.__name__, String('__main__')))) {
			track.lineno=5;
			t = TestApp.Temp();
			track.lineno=6;
			if (pyjslib.bool((t.s===undefined?(function(){throw new TypeError('t.s is undefined')})():(typeof t.s == 'function' && t.__is_instance__?pyjslib.getattr(t, 's'):t.s)))) {
				track.lineno=7;
				pyjslib.printFunc([String('xxx')], 1);
			}
		}

	} catch (pyjs_attr_err) {throw pyjslib._errorMapping(pyjs_attr_err)};
return this;
}; /* end TestApp */ 




TestApp_loaded_fn = function() {
}

TestApp_prepare_mod = function() {
    if ((typeof (module_load_request['TestApp']) == 'undefined') ||
        (module_load_request['TestApp'] < 2)) {
        module_load_request['TestApp'] = 2;
    }
    var modnames = new pyjslib.List([
		
	]);
    sys.overrides.update(new pyjslib.Dict({
		
	}));
    path = sys.loadpath;
    /*
    pyjslib.preload_app_modules(path, modnames, TestApp_loaded_fn,
                                            0,
                                            null);
                                            //'TestApp');
                                            */
    //alert("module ajax loaded fn called TestApp");

    if (sys.appname != 'TestApp')
    {
        if (module_load_request['TestApp'] < 3) {
            module_load_request['TestApp'] = 3;
        }
    }
}

//alert("module ajax loaded TestApp");

TestApp_prepare_mod();




var wait_count = 0;

var onExecutionError = function (exception, name) {
    var extra = sys.trackstackstr();
    if (extra == '') {
        if (exception.name.indexOf('HaltException', 0) < 0) { 
            extra = "\n.  Rebuild with pyjsbuild -d for more information.";
        }
    } else {
        extra = "\n" + extra;
    }
    alert( "In application " + name + " - " + 
          exception.name + ': '  + exception.message + extra);
};

function TestApp_imported() {
    TestApp.__name__ = '__main__';
    try {
        modules['TestApp'] = TestApp('__main__');
    } catch (exception) {
        sys.save_exception_stack();
        onExecutionError(exception, 'TestApp');
    }
}

function prepare_app() {
    var app_modnames = new pyjslib.List([
		new pyjslib.List([
			'TestApp'])
	]);
    pyjslib.preload_app_modules(sys.loadpath,
                                app_modnames, TestApp_imported,
                                0,
                                'TestApp');
}

function pygwtOnLoad(onLoadError, name) {
    if (onLoadError != null)
        try {
            prepare_app();
        } catch (exception) {
            onLoadError(exception, name);
        }
    else {
        prepare_app();
    }
}

--></script>
</body>
</html>
